-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodeup 1097.c
More file actions
43 lines (42 loc) · 829 Bytes
/
codeup 1097.c
File metadata and controls
43 lines (42 loc) · 829 Bytes
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
#include <stdio.h>
int main()
{
int a[20][20] = { 0 };
int i, j, n, x, y;
for (i = 1; i <= 19; i++)
{
for (j = 1; j <= 19; j++) {
scanf("%d", &a[i][j]);
}
}
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
scanf("%d %d", &x, &y);
for (j = 1; j <= 19; j++)
{
if (a[x][j] == 0) {
a[x][j] = 1;
}
else {
a[x][j] = 0;
}
}
for (j = 1; j <= 19; j++)
{
if (a[j][y] == 0) {
a[j][y] = 1;
}
else {
a[j][y] = 0;
}
}
}
for (i = 1; i <= 19; i++)
{
for (j = 1; j <= 19; j++) {
printf("%d ", a[i][j]);
}
printf("\n");
}
}