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.
20 lines
625 B
20 lines
625 B
1 week ago
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
int studentId[3];
|
||
|
float mathScore[3];
|
||
|
float physicsScore[3];
|
||
|
float englishScore[3];
|
||
|
float totalScore[3];
|
||
|
for (int i = 0; i < 3; i++) {
|
||
|
scanf("%d", &studentId[i]);
|
||
|
scanf("%f", &mathScore[i]);
|
||
|
scanf("%f", &physicsScore[i]);
|
||
|
scanf("%f", &englishScore[i]);
|
||
|
totalScore[i] = mathScore[i] + physicsScore[i] + englishScore[i];
|
||
|
}
|
||
|
for (int i = 0; i < 3; i++) {
|
||
|
printf("%d %0.1f %0.1f %0.1f %0.1f\n", studentId[i], mathScore[i], physicsScore[i], englishScore[i], totalScore[i]);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|