PAT乙级 1061 判断题

把当时的代码放出来,大家共同学习,互相帮助
题目:

输入样例:

3 6
2 1 3 3 4 5
0 0 1 0 1 1
0 1 1 0 0 1
1 0 1 0 1 0
1 1 0 0 1 1

输出样例:

13
11
12

代码如下(Python):

lst = list(map(int, input().split()))
question_score = list(map(int, input().replace(' ', '')))
right_answer = input().replace(' ', '')
student_answer = [input().replace(' ', '')for i in range(lst[0])]
student_score = [0 for j in range(lst[0])]
for i in range(lst[0]):
    for j in range(lst[1]):
        if student_answer[i][j] == right_answer[j]:
            student_score[i] += question_score[j]
for k in student_score:
    print(k)
发布了65 篇原创文章 · 获赞 25 · 访问量 1039

猜你喜欢

转载自blog.csdn.net/chongchujianghu3/article/details/104984183
今日推荐