-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1058.c
More file actions
57 lines (52 loc) · 1.17 KB
/
1058.c
File metadata and controls
57 lines (52 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
int question[1005][2];//保存问题的分值和选项个数
int wrong[1005] = { 0 };
char answer[1005][6];//保存问题的答案。
int stmarks[1005] = { 0 };
char response[1005][1005][6];
int main()
{
int N, M;
scanf("%d %d", &N, &M);
for (int i = 0; i < M; i++)
{
char c;
int count = 0;
int temp;
char tempc[100];
scanf("%d", &question[i][0]);
scanf("%d", &temp);
scanf("%d", &question[i][1]);
while (count != question[i][1])
{
c = getchar();
if (c >= 'a' && c <= 'z')
answer[i][count++] = c;
}
}
for(int i = 0; i < N; i++)
for (int j = 0; j < M; j++)
{
int count = 0;
char c;
while ((c = getchar()) != ')')
if (c >= 'a' && c <= 'z')
response[i][j][count++] = c;
if (strcmp(response[i][j], answer[j]))
wrong[j]++;
else
stmarks[i] += question[j][0];
}
for(int i = 0; i < N; i++)
printf("%d\n", stmarks[i]);
int max = 0;
for(int i = 0; i < M; i++)
if(wrong[i] > max)
max = wrong[i];
printf("%d", max);
for(int i = 0; i < M; i++)
if(max == wrong[i])
printf(" %d", i + 1);
}