1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 21:58:41 +00:00
202401-programming-assignments/【实践课外】3.选择结构2/7-6 选择-奖学金.c

33 lines
581 B
C
Raw Normal View History

2024-10-23 03:12:50 +00:00
#include <stdio.h>
int main() {
int id, avg_score, dis_score, is_cadre, paper_num;
int ans = 0;
scanf("%d%d%d%d%d", &id, &avg_score, &dis_score, &is_cadre, &paper_num);
// 院士奖学金
if (avg_score > 80 && paper_num >= 1) {
ans += 8000;
}
// 五四奖学金
if (avg_score > 85 && dis_score > 80) {
ans += 4000;
}
// 成绩优秀奖
if (avg_score > 90) {
ans += 2000;
}
// 班级贡献奖
if (dis_score > 80 && is_cadre) {
ans += 850;
}
printf("%d\n", ans);
return 0;
}