#include <stdio.h>
typedef struct{
int id;
int weight;
int height;
}Body;
void swap(Body *x,Body *y);
int main(void) {
// your code goes here
Body a[]={{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=0;j<4;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 *x,Body *y){
Body temp;
temp=*x;
*x=*y;
*y=temp;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHN0cnVjdHsKCWludCBpZDsKCWludCB3ZWlnaHQ7CglpbnQgaGVpZ2h0Owp9Qm9keTsKdm9pZCBzd2FwKEJvZHkgKngsQm9keSAqeSk7CgppbnQgbWFpbih2b2lkKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglCb2R5IGFbXT17ezEsNjUsMTY5fSwKCQkJICB7Miw3MywxNzB9LAoJCSAgICAgIHszLDU5LDE2MX0sCgkJCSAgezQsNzksMTc1fSwKCQkJICB7NSw1NSwxNjh9LAoJfTsKCWZvcihpbnQgaT0wO2k8NDtpKyspewoJCWZvcihpbnQgaj0wO2o8NDtqKyspCgkJaWYoYVtqXS5oZWlnaHQ8YVtqKzFdLmhlaWdodCkKCQkJc3dhcCgmYVtqXSwmYVtqKzFdKTsKCX0KCWZvcihpbnQgaT0wO2k8NTtpKyspewoJcHJpbnRmKCIlZCwlZCwlZFxuIixhW2ldLmlkLGFbaV0ud2VpZ2h0LGFbaV0uaGVpZ2h0KTsKCX0KCQoJcmV0dXJuIDA7Cn0Kdm9pZCBzd2FwKEJvZHkgKngsQm9keSAqeSl7CglCb2R5IHRlbXA7Cgl0ZW1wPSp4OwoJKng9Knk7CgkqeT10ZW1wOwp9Cg==
4,79,175
2,73,170
1,65,169
5,55,168
3,59,161