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