/* Note:Your choice is C IDE */#include "stdio.h"void main(){ enum color{blue,red,yellow,white,black}; enum color i,j,k,pri; int loop,n=0; for(i=blue;i<=black;i++) { for(j=blue;j<=black;j++) { if(i!=j) { for(k=blue;k<=black;k++) { if((k!=i)&&(k!=j)) { n++; printf("%-8d",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 blue:printf("%-8s","blue"); case red:printf("%-8s","red"); case yellow:printf("%-8s","yellow"); case white:printf("%-8s","white"); case black:printf("%-8s","black"); default:break; } } printf("\n"); } } } } } printf("total:%8d",n);}
- 2 回答
- 0 关注
- 1170 浏览
添加回答
举报
0/150
提交
取消