List two table tennis team to compete, programmed to find three pairs of racers

Two table tennis team to compete, each out of three people. A team of A, B, C 3 people, B team for X, Y, Z 3 people. List of game has been determined by lot.

     It was to find out the list of game players, A and X said he did not than, C said he did not and X, Z ratio, programmed to identify a list of three pairs of racing.

. 1 #include <stdio.h>
 2  int main ()
 . 3  {
 . 4      char I, J, K;
 . 5      for (I = ' X ' ; I <= ' Z ' ; I ++)   // find A circulating opponent 
. 6      {
 . 7          for (J = ' X ' ; J <= ' Z ' ; J ++)         // iterate over B opponent 
. 8          {
 . 9              IF (! I = J)             // because they can not duplicate entry is determined to write separated by a 
10              {
 11                 for (K = ' X ' ; K <= ' Z ' ; K ++) // iterate over C opponents 
12 is                  {
 13 is                      IF (!! K = I && K = J)         // still not duplicate entries 
14                      {
 15                          IF (I ! = ' X ' ! && = K ' X ' ! && K = ' Z ' )   // known conditions and who do not match 
16                          {
 . 17                              the printf ( " A C% \ n- " , I);
18                             printf("b%c\n", j);
19                             printf("c%c\n", k);
20                         }
21                     }
22                 }
23             }
24         }
25     }
26     return 0;
27 }

 

Guess you like

Origin www.cnblogs.com/old-horse/p/12498450.html