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