#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+CiAKdHlwZWRlZiBzdHJ1Y3R7CiBpbnQgaWQ7CiBpbnQgd2VpZ2h0OwogaW50IGhlaWdodDsKfUJvZHk7CiAKCnZvaWQgc3dhcChCb2R5ICphLCBCb2R5ICpiKXsKIEJvZHkgdGVtcCA9ICphOwogKmEgPSogYjsKICpiID0gdGVtcDsKCgl9CiAKCmludCBtYWluKCkgewogQm9keSBhWzVdPXsKICB7MSwgNjUsIDE2OX0sCiAgezIsIDczLCAxNzB9LAogIHszLCA1OSwgMTYxfSwKICB7NCwgNzksIDE3NX0sCiAgezUsIDU1LCAxNjh9CiB9OwogCiBmb3IoaW50IGk9MDsgaTw1OyBpKyspewogIGludCBtYXg9aTsKICBmb3IgKGludCBqPWkrMTsgajw1OyBqKyspewogICBpZihhW2pdLmhlaWdodD5hW21heF0uaGVpZ2h0KXsKICAgIG1heD1qOwogICB9CiAgfQogIGlmKG1heCAhPWkpewogICBzd2FwKCZhW2ldLCAmYVttYXhdKTsKICB9CiB9CiAKIAogZm9yKGludCBpPTA7IGk8NTsgaSsrKXsKICBwcmludGYoIiVkICAgICVkICAgICVkXG4iLCBhW2ldLmlkLCBhW2ldLndlaWdodCwgYVtpXS5oZWlnaHQpOwogfQogCiByZXR1cm4gMDsKfQ==