#include <stdio.h>
#include <string.h>
// 共用体：互斥数据（奖学金/助学贷款不同时存在）
union Finance {
    float scholarship;
    float loan;
};
struct Student {
    char name[20];
    int isScholarship; // 标记：1=有奖学金，0=有助学贷款
    union Finance money; // 嵌套共用体
};
int main() {
    struct Student s;
    strcpy(s.name, "王五");
    s.isScholarship = 1;
    if (s.isScholarship) {
        s.money.scholarship = 5000.0; // 赋值奖学金
        printf("%s: 奖学金%.2f元\n", s.name, s.money.scholarship);
    } else {
        s.money.loan = 8000.0; // 赋值助学贷款
        printf("%s: 助学贷款%.2f元\n", s.name, s.money.loan);
    }
    return 0;
}