Current location - Education and Training Encyclopedia - Graduation thesis - Boolean matrix (programmed in C language)
Boolean matrix (programmed in C language)
# include & ltstdio.h & gt

# include & ltstring.h & gt

int? Master ()

{

//freopen("in.txt "," r ",stdin);

int? n,m[ 100][ 100],r[ 100],c[ 100],I,j,x,y,R,C;

while(scanf("%d ",& ampn)! =EOF,n)

{

memset(r,0,sizeof(r));

memset(c,0,sizeof(c));

for(I = 0; I & ltn;; i++)

for(j = 0; j & ltn; j++)

{

scanf("%d ",& ampm[I][j]);

r[I]+= m[I][j];

c[j]+= m[I][j];

}

for(R = C = I = 0; I & ltn;; i++)

{

if(r[i]%2)

{

r++;

x = I+ 1;

}

if(c[i]%2)

{

c++;

y = I+ 1;

}

}

If (! R & amp& amp! c)

puts(" OK ");

Or what? if(R = = 1 & amp; & ampC== 1)

Printf ("change? Bit? (%d,%d)\n ",x,y);

other

Puts ("corruption");

}

Return? 0;

I heard that the answer is long enough to be adopted automatically?