#include <stdio.h>
typedef struct{
int ID;
int weight;
int height;
}Body;
void swap(Body *b);
int main(void) {
Body a[] = {
{1,65,169},
{2,73,173},
{3,59,161},
{4,79,175},
{5,55,168}
};
swap(a);
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 *b)
{
Body x;
for(int i=0;i<5;i++){
for(int j=i+1;j<5;j++){
if(b[i].height<b[j].height){
x=b[i];
b[i]=b[j];
b[j]=x;
}
}
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHN0cnVjdHsKCWludCBJRDsKCWludCB3ZWlnaHQ7CglpbnQgaGVpZ2h0Owp9Qm9keTsKCnZvaWQgc3dhcChCb2R5ICpiKTsKCmludCBtYWluKHZvaWQpIHsKCQoJQm9keSBhW10gPSB7CgkJezEsNjUsMTY5fSwKCQl7Miw3MywxNzN9LAoJCXszLDU5LDE2MX0sCgkJezQsNzksMTc1fSwKCQl7NSw1NSwxNjh9Cgl9OwoJCglzd2FwKGEpOwoJZm9yKGludCBpPTA7aTw1O2krKyl7CglwcmludGYoIiVkICVkICVkXG4iLGFbaV0uSUQsYVtpXS53ZWlnaHQsYVtpXS5oZWlnaHQpOwoJfQoJcmV0dXJuIDA7Cn0Kdm9pZCBzd2FwKEJvZHkgKmIpCnsKCUJvZHkgeDsKCWZvcihpbnQgaT0wO2k8NTtpKyspewoJZm9yKGludCBqPWkrMTtqPDU7aisrKXsKCQlpZihiW2ldLmhlaWdodDxiW2pdLmhlaWdodCl7CgkJeD1iW2ldOwoJCWJbaV09YltqXTsKCQliW2pdPXg7CgkJfQoJfQp9Cn0KCgo=