您的位置:首页 > 其它

1061. 判断题(15)

2016-12-28 17:48 288 查看
#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: