-
Notifications
You must be signed in to change notification settings - Fork 0
/
A.cpp
38 lines (38 loc) · 959 Bytes
/
A.cpp
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
#include<stdio.h>
int main()
{
int ara[4][4],ans[4][4],i,j;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&ara[i][j]);
}
ans[0][0]=ara[0][0]+ara[0][1]+ara[1][0];
ans[0][1]=ara[0][0]+ara[0][1]+ara[0][2]+ara[1][1];
ans[0][2]=ara[0][1]+ara[0][2]+ara[1][2];
ans[1][0]=ara[0][0]+ara[1][0]+ara[1][1]+ara[2][0];
ans[1][1]=ara[0][1]+ara[1][0]+ara[1][1]+ara[1][2]+ara[2][1];
ans[1][2]=ara[0][2]+ara[1][1]+ara[1][2]+ara[2][2];
ans[2][0]=ara[1][0]+ara[2][0]+ara[2][1];
ans[2][1]=ara[1][1]+ara[2][0]+ara[2][1]+ara[2][2];
ans[2][2]=ara[1][2]+ara[2][1]+ara[2][2];
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
if(ans[i][j]%2==0)
ans[i][j]=1;
else
ans[i][j]=0;
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d",ans[i][j]);
}
printf("\n");
}
return 0;
}