某班期末考试科目为数学(MT)、英语(EN)和物理(PH),有最多不超过40人参加考试。请编程计算:(1)每个学生的总分和平均分;(2)每门课程的总分和平均分。 **输入格式要求:"%d" "%ld"(学号) 提示信息:"Input the total number of the students(n<40):" "Input student’s ID and score as: MT EN PH:\n" **输出格式要求:"Counting Result:\n" "Student’s ID\t MT \t EN \t PH \t SUM \t AVER\n" "%12ld\t"(打印学号) "%4d\t"(打印每门课成绩)"%4d\t%5.1f\n"(打印总分和平均分) "SumofCourse \t" "%4d\t"(打印每门课的总分) "\nAverofCourse\t" "%4.1f\t"(每门课的平均分) 程序的运行示例如下: Input the total number of the students(n<40):4 Input student’s ID and score as: MT EN PH: 070310122 97 87 92 070310123 92 91 90 070310124 90 81 82 070310125 73 65 80 Counting Result: Student’s ID MT EN PH SUM AVER 70310122 97 87 92 276 92.0 70310123 92 91 90 273 91.0 70310124 90 81 82 253
某班期末考试科目为数学(MT)、英语(EN)和物理(PH),有最多不超过40人参加考试。请编程计算:(1)每个学生的总分和平均分;(2)每门课程的总分和平均分。
于 2023-11-29 16:28:45 首次发布