1 #include <stdio.h>
2
3 int main()
4 {
5 int x, y, z;
6 for (x = 1; x <= 3; x++)
7 for (y = 1; y <= 3; y++)
8 for (z = 1; z <= 3; z++)
9 if (x!=1&&x!=3&&z!=3&&x!=y&&x!=z&&y!=z)
10 {
11 printf("X will marry to %c.\n", 'A'+x-1);
12 printf("Y will marry to %c.\n", 'A'+y-1);
13 printf("Z will marry to %c.\n", 'A'+z-1);
14 }
15 return 0;
16 }
[root@localhost 48]# vim marry.c
[root@localhost 48]# ./a.out
X will marry to B.
Y will marry to C.
Z will marry to A.