求大佬看看怎么回事,我在自己的软件上面运行没问题,但验证却一片红
查看原帖
求大佬看看怎么回事,我在自己的软件上面运行没问题,但验证却一片红
1478940
yuchen2006楼主2024/10/19 01:57
#include <stdio.h>

typedef struct {
    int xuehao;
    int chengji1;
    int chengji2;
    int total;
} Student;

int zongfen(Student stu);
int pingfen(Student stu);

int main() {
    int a;
    scanf("%d", &a);

    Student stu[1000];

    for (int i = 0; i < a; i++) {
        scanf("%d %d %d", &stu[i].xuehao, &stu[i].chengji1, &stu[i].chengji2);
        stu[i].total = zongfen(stu[i]);
    }

    for (int i = 0; i < a; i++) {
        if (pingfen(stu[i])) {
            printf("Excellent\n");
        }
        else {
            printf("Not Excellent\n");
        }
    }

    return 0;
}

int zongfen(Student stu) {
    return stu.chengji1 + stu.chengji2;
}

int pingfen(Student stu) {
    int f = 1;
    if (stu.total < 140 || stu.chengji1 * 7 + stu.chengji2 * 3 < 800) {
        f = 0;
    }
    return f;
}
2024/10/19 01:57
加载中...