Follows 541.c (Total 32 lines):

/* @JUDGE_ID:4461XX 541 C */
/* A */
#include <stdio.h>
void main( void )
{
	int a[100][100] ;
	while( 1 )
	{
		int i , j , n , number , row=0 , colunm=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( i=0 ; i<n ; i++ )
		{
			number=0 ;
			for( j=0 ; j<n ; j++ ) number+=a[i][j] ;
			if( number%2==1 && row==0 ) row=i+1 ;
			else if( number%2==1 && row!=0 ) row=-1 ;
		}
		for( i=0 ; i<n ; i++ )
		{
			number=0 ;
			for( j=0 ; j<n ; j++ ) number+=a[j][i] ;
			if( number%2==1 && colunm==0 ) colunm=i+1 ;
			else if( number%2==1 && colunm!=0 ) colunm=-1 ;
		}
		if( row==0 && colunm==0 ) printf( "OK\n" ) ;
		else if( row==-1 || colunm==-1 ) printf( "Corrupt\n" ) ;
		else printf( "Change bit (%d,%d)\n" , row , colunm ) ;
	}
}

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com