测试第三片,我贴C的代码!
测试!
贴代码!
下面哪里有错的啊?兄弟么?
#include<stdio.h>
void main()
{
enum fruit {apple,orange,banana,pineapple,pear};
enum fruit x,y,z,temp;
int i=0,loop;
for(x=apple;x<=pear;x++)
for(y=apple;y<=pear;y++)
if(x!=y)
{
for(z=apple;z<=pear;z++)
{
if((x!=z)&&(y!=z))
{
i++;
printf("CASE %d:",i);
for(loop=1;loop<=3;loop++)
{
switch(loop)
{
case 1:temp=x;break;
case 2:temp=y;break;
case 3:temp=z;break;
}
switch(temp)
{
case 1:printf("apple ");break;
case 2:printf("orange ");break;
case 3:printf("banana ");break;
case 4:printf("pineapple ");break;
case 5:printf("pear ");break;
}
loop++;
}
printf("n");
}
}
}
|
作者: 凝望长空
发布时间: 2010-12-14