#include
#include
void main(){
int a,b,c;
char str[4]={'+','-','*','/'};
double d,num;
srand(time(NULL));
a=rand()%90+10;
b=rand()%10+1;
c=rand()%4;
switch(str[c])
{
case '+':d=a+b;break;
case '-':d=a-b;break;
case '*':d=a*b;break;
case '/':d=a*1.0/b;break;
}
printf("%d%c%d=",a,str[c],b);
scanf("%lf",&num);
if(num==d) printf("Right!");
else
(c!=3)?printf("Wrong!\n%d%c%d=%d",a,str[c],b,(int)d):printf("Wrong!\n%d%c%d=%lf",a,str[c],b,d);
}
呵呵^_^小伙子,天门职业学校的吧!就问你难不难?虽然我不会,但是我觉得,这个玩意估计也是比较简单一点点的。不过难到你 呵呵^_^还是挺容易的。(≧ω≦)/