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