Please program to find the list of players from the three teams. (Clear and concise)

.Two table tennis teams compete, each with three players, team A has three players a, b, and c, and team B has three players x, y, and z. Lots have been drawn to determine the third list. //Someone asked the team members for the list of matches. a says he is not compared with x, c says he is not compared with x and z.

#include <stdio.h>

int main()

{
    
    
  char i, j, k; //a,b,c
  for (i = 'x'; i <= 'z'; i++)
  {
    
    
    for (j = 'x'; j <= 'z'; j++)
    {
    
    
      if (i != j)
      {
    
    
        for (k = 'x'; k <= 'z'; k++)
        {
    
    
          if (i != k && j != k)
          {
    
    
            if (k != 'x' && k != 'z' && i != 'x')
            {
    
    
              printf("a-%c,b-%c,c-%c\n", i, j, k);
              goto over;//跳到指定位置
            }
          }
        }
      }
    }
  }
over:
  return 0;
}

Guess you like

Origin blog.csdn.net/and_what_not/article/details/113846159