解题思路:
注意事项:
参考代码:
class Student: def input(self, student_id, name, score): self.student_id = student_id self.name = name self.Chinese_score = int(score[0]) self.math_score = int(score[1]) self.English = int(score[2]) def print(self): print(self.student_id, self.name, self.Chinese_score, self.math_score, self.English, sep=" ") all_list = [] number = int(input()) average = {"Chinese": 0, "math": 0, "English": 0} ave = {} for i in range(number): s = Student() num_list = list(input().split()) t = num_list[2:] s.input(num_list[0], num_list[1], t) all_list.append(s) for j in all_list: average["Chinese"] += j.Chinese_score average["math"] += j.math_score average["English"] += j.English t = (j.Chinese_score + j.math_score + j.English) / 3 ave[all_list.index(j)] = t print(average["Chinese"] // number, average["math"] // number, average["English"] // number) max_score = max(ave.values()) for m in ave.keys(): if ave[m] == max_score: all_list[m].print() break
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:583 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)for循环浏览:1178 |
【亲和数】 (C语言代码)浏览:530 |
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:566 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:702 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:593 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:583 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:701 |
1025题解浏览:796 |
星期判断机 (C语言代码)浏览:892 |