#include <stdio.h>

typedef struct {
    int id;
    int weight;
    int height;
} Body;


void swap(Body *p1, Body *p2){
    int t_id = p1->id;
    p1->id = p2->id;
    p2->id = t_id;

    int t_w = p1->weight;
    p1->weight = p2->weight;
    p2->weight = t_w;

    int t_h = p1->height;
    p1->height = p2->height;
    p2->height = t_h;
}

int main(void) {
    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 = 0; j < n - 1 - i; j++) {
            if (a[j].height < a[j + 1].height) {
                swap(&a[j], &a[j + 1]);
            }
        }
    }

    for (int i = 0; i < n; i++) {
        printf("Id;%d, 体重;%d, 身長;%d\n", a[i].id, a[i].weight, a[i].height);
    }

    return 0;
}

