| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
路过的帮忙看看,为什么wa?#include<stdio.h>
int main()
{
int i,j,n,t,k,p,sum1,sum2,x,a[100][100],b[100],c[100];
while(1)
{
t=0;
x=0;
scanf("%d",&n);
if(n==0)break;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
for(t=0,p=0;p<n;p++)
{
for(sum1=0,k=0;k<n;k++)
{
sum1+=a[p][k];
}
if(sum1%2!=0)b[t++]=p;
}
for(x=0,p=0;p<n;p++)
{
for(sum2=0,k=0;k<n;k++)
{
sum2+=a[k][p];
}
if(sum2%2!=0)c[x++]=p;
}
if(t==0&&x==0) printf("OK\n");
else if(t==1&&x==1&&a[b[t-1]][c[x-1]]==1) printf("Change bit (%d,%d)\n",b[t-1]+1,c[x-1]+1);
else printf("Corrupt\n");
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator