c语言scanf("%d%c%d%c",&a,&b,&c,&d");中文的标点符号错误,switch前缺‘;’,怎么改?
推荐回答
123456789101112131415161718192021#include <<a href="http://www.baidu./s?wd=stdio.h&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YvrjT4uH0YuHu-njwhmW9b0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHnsPjcsnW6zPWczrjD4n104rf" target="_blank" class="baidu-highlight">stdio.h</a>>int main(){ printf("wlee to simple caculater!\nattention please:\ninput form:a+b=\n"); double a,c,e; char b,d; do{ scanf("%d%c%d%c",&a,&b,&c,&d); // 该语句最后的分号不是英文分号 switch(b) { case'+':e=a+c;break; case'*':e=a*c;break; case'-':e=a-c;break; case'/':e=a/c;break; default:printf("please input your right equation\n");} printf("%g%c%g=%d\npress Q to quit,or c to continue",a,b,c,e); d=getchar(); }while(d='c'); printf("thanks for your using"); return 0;}
;和 ; 是有区别的