#include <stdio.h>

// Body構造体を定義
typedef struct {
    int id;       // ID
    int weight;   // 体重
    int height;   // 身長
} Body;

// 関数の宣言
void swap(Body data[]);
void display(Body data[]);

int main(void) {
    // Body構造体配列を初期化
    Body data[] = {
        {1, 65, 169},
        {2, 73, 170},
        {3, 59, 161},
        {4, 79, 175},
        {5, 55, 168}
    };
    
    // データを並び替え
    swap(data);
    
    // 結果を表示
    display(data);

    return 0;
}

// swap関数：データを身長の逆順に並び替える
void swap(Body data[]) {
    Body temp;

    // 配列の順序を入れ替える
    temp = data[0];
    data[0] = data[4];
    data[4] = temp;

    temp = data[1];
    data[1] = data[3];
    data[3] = temp;

    // data[2]（中央）はそのままでOK
}

// display関数：データを表示
void display(Body data[]) {
    for (int i = 0; i < 5; i++) {
        printf("ID: %d, Weight: %d, Height: %d\n", data[i].id, data[i].weight, data[i].height);
    }
}