#include <stdio.h>
typedef struct{
int id;
int weight;
int height;
}Body;
void swap(Body *x,Body *y){
Body temp = *x;
*x =*y;
*y = temp;
}
int main(){
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-1;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+Cgp0eXBlZGVmIHN0cnVjdHsKCWludCBpZDsKCWludCB3ZWlnaHQ7CglpbnQgaGVpZ2h0Owp9Qm9keTsKCnZvaWQgc3dhcChCb2R5ICp4LEJvZHkgKnkpewoJCglCb2R5IHRlbXAgPSAqeDsKCSp4ID0qeTsKCSp5ID0gdGVtcDsKfQoKaW50IG1haW4oKXsKCUJvZHkgYVtdPXt7MSw2NSwxNjl9LHsyLDczLDE3MH0sezMsNTksMTYxfSx7NCw3OSwxNzV9LHs1LDU1LDE2OH0KfTsKCmludCBuPXNpemVvZihhKS9zaXplb2YoYVswXSk7Cgpmb3IoaW50IGk9MDtpPG4tMTtpKyspewoJZm9yKGludCBqPTA7ajxuLTE7aisrKXsKCQlpZihhW2pdLmhlaWdodDxhW2orMV0uaGVpZ2h0KXsKCQkJc3dhcCgmYVtqXSwmYVtqKzFdKTsKCQl9Cgl9Cn0KCmZvcihpbnQgaT0wO2k8bjtpKyspewoJcHJpbnRmKCIlZCwgJWQsJWRcbiIsYVtpXS5pZCxhW2ldLndlaWdodCxhW2ldLmhlaWdodCk7Cn0KCnJldHVybiAwOwoKfQo=
4, 79,175
2, 73,170
1, 65,169
5, 55,168
3, 59,161