C language practice

Title:

Two table tennis teams compete, and each team has three players. Team A consists of A, B and C3, while Team B consists of X, Y and Z3.

The competition list was decided by drawing lots. Someone asked the players about the list of matches. A said he didn't compete with X, and C said he didn't compete with X and Z.

Please make up a program to find the list of three couples.

Answer:

# include & ltstdio.h & gt

void main()

{

char i,j,k;

for(I = ' X '); I<=' Zi++)

for(j = ' X '); j & lt= ' Zj++)

If (me! =j)

for(k = ' X '); k & lt= ' Zk++)

If (me! = k & amp& ampj! =k)

If (me! = ' X ' & amp& ampk! = ' X ' & amp& ampk! ='Z ')

printf("A - %c\nB - %c\nC - %c\n ",I,j,k);

}