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