#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");
}
}
}
|