China Naming Network - Company naming - Help to write a simple small program in C language.

Help to write a simple small program in C language.

Define three character variables

Because a, b and c may be compared with one of x, y, z, y and z.

So use a three-layer cycle to make everything clear.

Yes, because A's opponent can't be the same as B.

Are looking for everything about B's opponent.

Make a conditional judgment, which is A! =B

Similarly, C's opponent can't be the same person as A and B's opponent.

So there's an a! = C & amp& ampb! =C

Finally, A said it would not compare with X, and C said it would not compare with X and Z..

Answer! = ' X ' & amp& ampc! = ' X ' & amp& ampc! ='Z '

# include & ltstdio.h & gt

# Define N 4

int main(void)

{

char A,B,C;

for(A = ' X '; A & lt= ' ZA++)

{

for(B = ' X '); B& lt; = ' ZB++)

{

If (a! =B)

{

for(C = ' X '); C & lt= ' ZC++)

{

If (a! = C & amp& ampb! =C)

{

If (a! = ' X ' & amp& ampc! = ' X ' & amp& ampc! ='Z ')

{

printf("\nAvs%c,Bvs%c,Cvs%c ",A,B,C);

}

}

}

}

}

}

}