case转换错误在main函数中~~~拜托帮忙看下怎么回事啊
#include <stdlib.h>#include <time.h>
#include <stdio.h>
#include <math.h>
main()
{
int data1,data2,i;
int count=0;
int reply;
srand(time(NULL));
while( count < 10 )
{
i=rand()%4+1;
switch(i)
case 1:
{
data1=rand()%11;
data2=rand()%11;
printf("%d+%d=",data1,data2);
scanf("%d",&reply);
}
break;
case 2:
{
data1=rand()%11;
data2=rand()%11;
while (data1<data2)
{
data1=rand()%11;
data2=rand()%11;
}
printf("%d-%d=",data1,data2);
scanf("%d",&reply);
}
break;
case 3:
{
data1=rand()%11;
data2=rand()%11;
printf("%d*%d=",data1,data2);
scanf("%d",&reply);
}
break;
case 4:
{
data1=rand()%11;
data2=rand()%11;
while(data2==0)
{
data1=rand()%11;
data2=rand()%11;
}
while(data2!=0)
{
int x=fmod(data1,data2);
while(x!=0)
{
data1=rand()%11;
data2=rand()%11;
}
}
printf("%d/%d=",data1,data2);
scanf("%d",&reply);
}
break;
count++;
}
}