#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(void) {
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++) {
for (int j=0;j<i+1;j++) {
if (a[i].height>a[j].height) {
swap(&a[i],&a[j]);
}
}
}
for(int i;i<5;i++){
printf("%d:%d:%d\n",a
[i
].
id,a
[i
].
weight,a
[i
].
height); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnR5cGVkZWYgc3RydWN0ewoJaW50IGlkOwoJaW50IHdlaWdodDsKCWludCBoZWlnaHQ7Cn1Cb2R5OwoKdm9pZCBzd2FwKEJvZHkqIGEsQm9keSogYil7CglCb2R5IHRlbXA9KmE7CgkqYT0qYjsKCSpiPXRlbXA7Cn0KCmludCBtYWluKHZvaWQpIHsKCUJvZHkgYVs1XSA9IHsKICAgICAgICB7MSwgNjUsIDE2OX0sCiAgICAgICAgezIsIDczLCAxNzB9LAogICAgICAgIHszLCA1OSwgMTYxfSwKICAgICAgICB7NCwgNzksIDE3NX0sCiAgICAgICAgezUsIDU1LCAxNjh9CiAgICB9OwoKICAgIGZvciAoaW50IGk9MDtpPDU7aSsrKSB7CiAgICAgICAgZm9yIChpbnQgaj0wO2o8aSsxO2orKykgewogICAgICAgICAgICBpZiAoYVtpXS5oZWlnaHQ+YVtqXS5oZWlnaHQpIHsKICAgICAgICAgICAgICAgIHN3YXAoJmFbaV0sJmFbal0pOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgCiAgICBmb3IoaW50IGk7aTw1O2krKyl7CiAgICAJcHJpbnRmKCIlZDolZDolZFxuIixhW2ldLmlkLGFbaV0ud2VpZ2h0LGFbaV0uaGVpZ2h0KTsKICAgIH0KCXJldHVybiAwOwp9Cg==