-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path1949.txt
More file actions
51 lines (49 loc) · 780 Bytes
/
1949.txt
File metadata and controls
51 lines (49 loc) · 780 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
44
45
46
47
48
49
50
51
#include<iostream>
#include<string>
using namespace std;
int a[100][100];
int b[100];
int c[100];
int main()
{
int i,j,m,s;
for(int n;cin>>n&&n!=0;)
{
int k=0,p=0;
for(i=1;i<=100;i++)
{
b[i]=0;
c[i]=0;
}
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
cin>>a[i][j];
b[i]+=a[i][j];
c[j]+=a[i][j];
}
for(i=1;i<=n;i++)
{
if(b[i]%2!=0)
{
m=i;
k++;
}
}
for(i=1;i<=n;i++)
{
if(c[i]%2!=0)
{
s=i;
p++;
}
}
if(k==0&&p==0)
cout<<"OK"<<endl;
else if(p==1&&k==1)//只有一行和一列是奇数的时候,改变一个才成立
cout<<"Change bit ("<<m<<","<<s<<")"<<endl;
else
cout<<"Corrupt"<<endl;
}
return 0;
}