#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=sizeof(a)/sizeof(a[0]);
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
if(a[i].height<a[j].height){
swap(&a[i],&a[j]);
}
}
}
for(int i=0;i<n;i++){
printf("%d,%d,%d\n",a
[i
].
id,a
[i
].
weight,a
[i
].
height); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHN0cnVjdHsKCWludCBpZDsKCWludCB3ZWlnaHQ7CglpbnQgaGVpZ2h0Owp9Qm9keTsKCnZvaWQgc3dhcChCb2R5KmEsQm9keSpiKXsKCUJvZHkgdGVtcD0qYTsKCSphPSpiOwoJKmI9dGVtcDsKfQoKaW50IG1haW4oKXsKCUJvZHkgYVtdPXsKCQl7MSw2NSwxNjl9LAoJCXsyLDczLDE3MH0sCgkJezMsNTksMTYxfSwKCQl7NCw3OSwxNzV9LAoJCXs1LDU1LDE2OH0KCX07CgkKCWludCBuPXNpemVvZihhKS9zaXplb2YoYVswXSk7CgkKCWZvcihpbnQgaT0wO2k8bi0xO2krKyl7CgkJZm9yKGludCBqPWkrMTtqPG47aisrKXsKCQkJaWYoYVtpXS5oZWlnaHQ8YVtqXS5oZWlnaHQpewoJCQkJc3dhcCgmYVtpXSwmYVtqXSk7CgkJCX0KCQl9Cgl9Cglmb3IoaW50IGk9MDtpPG47aSsrKXsKCQlwcmludGYoIiVkLCVkLCVkXG4iLGFbaV0uaWQsYVtpXS53ZWlnaHQsYVtpXS5oZWlnaHQpOwoJfQoJcmV0dXJuIDA7Cn0KCg==
4,79,175
2,73,170
1,65,169
5,55,168
3,59,161