#include <stdio.h>
typedef struct{
int ID;
int weight;
int height;
}Body;
void swap(Body *i,Body *j);
int main(void) {
Body a[] = {{1,65,169},{2,73,170},{3,59,161},{4,79,175},{5,55,168}};
int n = sizeof(a)/sizeof(a[0]);
for(int i=0;i<n-1;i++){
for(int j=0;j<n-i-1;j++){
if(a[j].height<a[j+1].height){
swap(&a[j],&a[j+1]);
}
}
}
for(int i=0;i<5;i++){
printf("%d.%d.%d\n",a
[i
].
ID,a
[i
].
weight,a
[i
].
height); }
return 0;
}
void swap(Body *i,Body *j){
Body a = *i;
*i = *j;
*j = a;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHN0cnVjdHsKCWludCBJRDsKCWludCB3ZWlnaHQ7CglpbnQgaGVpZ2h0Owp9Qm9keTsKCnZvaWQgc3dhcChCb2R5ICppLEJvZHkgKmopOwoKaW50IG1haW4odm9pZCkgewoJQm9keSBhW10gPSB7ezEsNjUsMTY5fSx7Miw3MywxNzB9LHszLDU5LDE2MX0sezQsNzksMTc1fSx7NSw1NSwxNjh9fTsKCQoJaW50IG4gPSBzaXplb2YoYSkvc2l6ZW9mKGFbMF0pOwoJCglmb3IoaW50IGk9MDtpPG4tMTtpKyspewoJCWZvcihpbnQgaj0wO2o8bi1pLTE7aisrKXsKCQkJaWYoYVtqXS5oZWlnaHQ8YVtqKzFdLmhlaWdodCl7CgkJCQlzd2FwKCZhW2pdLCZhW2orMV0pOwoJCQl9CgkJfQoJfQoKCWZvcihpbnQgaT0wO2k8NTtpKyspewoJCXByaW50ZigiJWQuJWQuJWRcbiIsYVtpXS5JRCxhW2ldLndlaWdodCxhW2ldLmhlaWdodCk7Cgl9CgkKCXJldHVybiAwOwp9Cgp2b2lkIHN3YXAoQm9keSAqaSxCb2R5ICpqKXsKCglCb2R5IGEgPSAqaTsKCSppID0gKmo7CgkqaiA9IGE7Cn0K