Python 3,10WA.实在是不知道哪错了,求大佬看看
查看原帖
Python 3,10WA.实在是不知道哪错了,求大佬看看
627174
Furioso楼主2022/5/12 13:54
n = int(input())
students = dict()
for i in range(n):
    stu = list(input().split())
    students[stu.pop(0)] = stu


def scholarship(a):
    money = 0
    if int(a[0]) > 80 and int(a[4]) >= 1:
        money += 8000
    if int(a[0]) > 85 and int(a[1]) > 80:
        money += 4000
    if int(a[0]) > 90:
        money += 2000
    if int(a[0]) > 85 and a[3] == 'Y':
        money += 1000
    if int(a[1]) > 80 and a[2] == 'Y':
        money += 850
    return money


s = x = 0
for key, value in students.items():
    money = scholarship(value)
    s += money
    students[key].append(money)
    if money > x:
        x = money
        name = key

print(f"{name}\n{x}\n{s}")
2022/5/12 13:54
加载中...