解题思路:没太懂题目中说最高分的意思,我理解是说输出最高的那个成绩所在的那组数据,但是还是有五十的错误。仅供参考。
注意事项:
参考代码:
def in_put(n):
xuehao = []
name = []
grade1 = []
grade2 = []
grade3 = []
an = [[] for _ in range(n)]
for i in range(n):
a,b,c,d,e = input().split()
xuehao.append(a)
name.append(b)
grade1.append(c)
grade2.append(d)
grade3.append(e)
an[i].append(a)
an[i].append(b)
an[i].append(int(c))
an[i].append(int(d))
an[i].append(int(e))
print("%d %d %d"%((int(grade1[0])+int(grade1[1]))/2,(int(grade2[0])+int(grade2[1]))/2,(int(grade3[0])+int(grade3[1]))/2))
gradelist = [int(grade1[0]),int(grade1[1]),int(grade2[0]),int(grade2[1]),int(grade3[0]),int(grade3[1])]
f = max(gradelist)
for j in range(n):
if f in an[j]:
for k in an[j]:
print(k,end = " ")
n = eval(input())
in_put(n)
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题9.10 (C语言代码)浏览:626 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1914 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:1015 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:548 |
WU-图形输出 (C++代码)浏览:836 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:687 |
用筛法求之N内的素数。 (C语言代码)浏览:685 |
Hello, world! (C++代码)浏览:1778 |
水仙花 (C语言代码)浏览:1163 |
A+B for Input-Output Practice (V) (C语言代码)浏览:497 |