diff --git a/学籍管理系统2.cpp b/学籍管理系统2.cpp new file mode 100644 index 0000000..35460c0 --- /dev/null +++ b/学籍管理系统2.cpp @@ -0,0 +1,20 @@ +#include + +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; +} \ No newline at end of file