#include<stdio.h>
int main()
{
enum Color {red, yellow, blue, white, black};
enum Color i, j, k, pri;
int n, loop;
n = 0;
for(i = red; i <= black; i++)
for(j = red; j <= black; j++)
if(i != j)
{
for(k = red; k <= black; k++)
if((k != i) && (k != j))
{
n = n + 1;
printf("%-4d", n);
for(loop = 1; loop <= 3; loop++)
{
switch(loop)
{
case 1: pri = i; break;
case 2: pri = j; break;
case 3: pri = k; break;
default: break;
}
switch(pri)
{
case red:printf("%-10s", “red”); break;
case yellow:printf("%-10s", “yellow”); break;
case blue:printf("%-10s", “blue”); break;
case white:printf("%-10s", “white”); break;
case black:printf("%-10s", “black”); break;
default: break;
}
}
printf("\n");
}
}
printf("\ntotal: %5d\n", n);
return 0;
}
相关文章
- 10-28leetcode 每日一题 91. 解码方法
- 10-28leetcode刷题-91解码方法
- 10-28Luogu P3381 (模板题) 最小费用最大流
- 10-28刷题-力扣-91. 解码方法
- 10-28Floyd最短路(板子题)
- 10-28<每日一题>题目28:生成随机的测验试卷(单选题)
- 10-2853. Minimum Window Substring
- 10-28三道博弈论入门题
- 10-28[整理]qbxt周末刷题班 Day2总结
- 10-28【网络流24题】餐巾计划问题