You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
708 B
25 lines
708 B
#include <stdio.h>
|
|
|
|
int main() {
|
|
int i;
|
|
char student_id[6];
|
|
float math_score, physics_score, english_score, total_score;
|
|
|
|
for (i = 1; i <= 3; i++) {
|
|
printf("请输入学号 %d: ", i);
|
|
scanf("%s", student_id);
|
|
printf("请输入高数成绩 %d: ", i);
|
|
scanf("%f", &math_score);
|
|
printf("请输入大学物理成绩 %d: ", i);
|
|
scanf("%f", &physics_score);
|
|
printf("请输入英语成绩 %d: ", i);
|
|
scanf("%f", &english_score);
|
|
|
|
total_score = math_score + physics_score + english_score;
|
|
|
|
printf("%s %.1f %.1f %.1f %.1f\n", student_id, math_score, physics_score, english_score, total_score);
|
|
}
|
|
|
|
return 0;
|
|
}
|