欢迎来到天天文库
浏览记录
ID:47041092
大小:39.50 KB
页数:6页
时间:2019-07-05
《C++简单计算器代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#includeusingnamespacestd;intprime1(intm);intprime2(intm);intprime3(intm);intprime4(intm);intprime5(intm);voidmain(){boolflag;intx,y,s,a,b,c,d,e,f,g;charn,ch;flag=true;while(flag){cout<<"请输入表达式,操作数与操作符之间用空格分隔"<>x>>n>>y;{if(n=='+')f=x+y;if
2、(n=='-')f=x-y;if(n=='*')f=x*y;if(n=='/')f=x/y;}cout<<"计算结果是:"<=0&&s<10){cout<<"";prime1(s);cout<=10&&s<100){a=s/10;b=s%10;cout<<""
3、;prime1(a);prime1(b);cout<=100&&s<1000){a=s/100;b=(s/10)%10;c=s%10;cout<<"";prime1(a);prime1(b);prime1(c);cout<4、out<<"";prime2(a);prime2(b);prime2(c);cout<=1000&&s<10000){a=s/1000;b=(s/100)%10;c=(s/10)%10;d=s%10;cout<<"";prime1(a);prime1(b)5、;prime1(c);prime1(d);cout<=0){if(f>=0&&6、f<10){prime1(f);cout<=10&&f<100){a=f/10;b=f%10;prime1(a);prime1(b);cout<7、=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<
4、out<<"";prime2(a);prime2(b);prime2(c);cout<=1000&&s<10000){a=s/1000;b=(s/100)%10;c=(s/10)%10;d=s%10;cout<<"";prime1(a);prime1(b)
5、;prime1(c);prime1(d);cout<=0){if(f>=0&&
6、f<10){prime1(f);cout<=10&&f<100){a=f/10;b=f%10;prime1(a);prime1(b);cout<7、=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<
7、=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<
此文档下载收益归作者所有