#include <cstdio>
int main(){
int N, M, grade[105], student[105], answer[105];
scanf("%d%d", &N, &M);
for(int i = 0; i < M; i++)
scanf("%d", &grade[i]);
for(int i = 0; i < M; i++)
scanf("%d", &answer[i]);
int result = 0;
int istrue = 0;
for(int i = 0; i < N; i++){ //N个学生
for(int j = 0; j < M; j++){ //将他们的答案与标准答案进行比较
scanf("%d", &student[j]);
if(answer[j] == student[j]) istrue = 1;
else istrue = 0;
result = result + grade[j] * istrue;
}
printf("%d\n", result); //输出每个人的分数
result = 0; //重置result统计下一个学生
}
return 0;
}
1061. 判断题(15)
最新推荐文章于 2021-04-05 14:34:53 发布