运行显示if(a symbol b==c) 错了,那个symbol应该怎么改啊?if语句里能用字符变量吗?求大神解答
#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ int a,b,c,count=0,flag=0,t; char symbol; do{ srand(time(0)); t=rand()%4; if(t==0) symbol='+'; if(t==1) symbol='-'; if(t==2) symbol='*'; if(t==3) symbol='/'; a=rand()%11; b=rand()%11; printf("%d%c%d=?\n",a,symbol,b); scanf("%d",&c); count++; if(a symbol b==c) flag++; }while(count<10); if(flag==10) printf("Right!\n"); else printf("Wrong!\n"); printf("你的得分是%d!正确率为%d%!",flag*10,flag*10); return 0;}