From 2f67b0c3b04fd5915e0511bd70d2a205c9642b5a Mon Sep 17 00:00:00 2001 From: ptslgaequ <2728416244@qq.com> Date: Sat, 16 Nov 2024 10:40:10 +0800 Subject: [PATCH] ADD file via upload --- 学籍管理系统2.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 学籍管理系统2.cpp 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