本文作者:qiaoqingyi

编程四则运算(编程四则运算的设计思路)

qiaoqingyi 2023-10-20 111

includeltstdiohvoid main int aint x,int yint bint x,int y int cint x,int yfloat dfloat x,float y int x,y scanfquot%d,%dquot,x,y printfquotx=%d,y=%d\nx+y=%d\。

includeltstdioh int main int a,b,sum,sub,mul,divscanfquot%d%dquot,a,bsum=a+bsub=abmul=a*bdiv=abprintfquot%d\n%d\n%d\n%d\nquot,sum,sub,mul,divreturn 0。

double a,bchar xprintfquotinput\nquotscanfquot%lf%c%lfquot,a,x,bswitchx case #39+#39 printfquot%2lf\nquot,a+b breakcase #39#39 printfquot%2lf\nquot,ab breakcase #39*#39。

int main double a, bchar opscanf quot%lfquot, awhile scanf quot%cquot, op op != #39=#39 scanf quot%lfquot, bif op == #39+#39 a = a+b else if op == #39#39 a = a。

编程四则运算(编程四则运算的设计思路)

阅读
分享