Python样例过了,结果全RE!!!
查看原帖
Python样例过了,结果全RE!!!
929115
zzzxns1楼主2023/2/20 12:47
n = int(input())#购买数量
a = list(map(int,input().split()))#中奖号码
cnt = 0#标记中几等奖
d = [0,0,0,0,0,0,0]#无奖时
for i in range(n):
    b = list(map(int,input().split()))
    for j in b:
        if j in a:
            cnt += 1
    if cnt == 1:
        d[6] += 1
    elif cnt == 2:
        d[5] += 1
    elif cnt == 3:
        d[4] += 1
    elif cnt == 4:
        d[3] += 1
    elif cnt == 5:
        d[2] += 1
    elif cnt == 6:
        d[1] += 1
    elif cnt == 7:
        d[0] += 1
    else:
        break
    cnt = 0
for i in d:
    print(i,sep=' ',end=' ')
2023/2/20 12:47
加载中...