正在加载图片...
第11章第9节 maino i enum color (red, yellow, blue, white);[switch enum color i,j,k i case red: printf( %os >,red); break; int sum=0 case yellow: printf(%S >,yellow); break for(ired: K<=white: i++ case blue: printf(%s”,“blue”); break; for (= red; K<=white;j++ default: printf(%s",“ white”); for(k=red; k<=white; k++) if(i=j&&il=&&jl==k) isum++ switch( printf("%d,%d,%d”,1,k) fcase red: printf("%os ',"red); break case yellow: printf(%s >,"yellow); break printf( sum=%d, sum) case blue: printf("%s”,“blue); break; default: printf(%os",“ white”); switch(k) &case red: printf(%s >,"red); break case yellow: printf(%os" yellow); break case blue: printf("%s”,“bue”); break; default: printf(%s >,"white")第11章第9节 main() { enum color {red,yellow,blue,white}; enum color i, j, k; int sum=0; for (i=red; i<=white ;i++) for (j=red; j<=white; j++) for (k=red ; k<=white; k++) if(i!=j&&i!=k&&j!==k) {sum++; printf(“%d, %d, %d”, i, j, k); } printf(“sum=%d”,sum); } switch(i) {case red: printf(“%s ”, “red”); break; case yellow: printf(“%s ”, “yellow”); break; case blue: printf(“%s ”, “blue”); break; default: printf(“%s ”, “white”); } switch(j) {case red: printf(“%s ”, “red”); break; case yellow: printf(“%s ”, “yellow”); break; case blue: printf(“%s ”, “blue”); break; default: printf(“%s ”, “white”); } switch(k) {case red: printf(“%s ”, “red”); break; case yellow: printf(“%s ”, “yellow”); break; case blue: printf(“%s ”, “blue”); break; default: printf(“%s ”, “white”); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有