Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

ze怎么 WA 11111!!!!

Posted by xwjwh at 2006-11-18 23:48:02 on Problem 2260
4
1 1 0 0
1 0 0 0
1 1 0 0
1 0 1 0
#include<stdio.h>
int main()
{
    int n,i,j,a[100][100],sum1,sum2,flag1,flag2;
    while(1)
    {
     scanf("%d\n",&n);
     if(n==0) break;
     sum1=0;sum2=0;flag1=0;flag2=0;
     for(i=0;i<n;i++)
      for(j=0;j<n;j++)
        scanf("%d",&a[i][j]); 
     for(i=0;i<n;i++)
     {
      for(j=0;j<n;j++)
      {
        sum2+=a[j][i];
        sum1+=a[i][j];
      }
      if(sum1%2==1)flag1=i+1;
      if(sum2%2==1)flag2=i+1; 
      sum1=0;sum2=0;
     }
     if(a[flag1-1][flag2-1]==1)printf("Change bit (%d,%d)\n",flag1,flag2);
     else if(flag1==0&&flag2==0)printf("OK\n");
     else printf("Corrupt\n");
        
   }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator