欢迎来到天天文库
浏览记录
ID:48535356
大小:39.50 KB
页数:6页
时间:2020-01-26
《C++简单计算器代码.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
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<<"请输入表达式,操作数与操作符之间用空格分隔"<
2、>x>>n>>y;{if(n=='+')f=x+y;if(n=='-')f=x-y;if(n=='*')f=x*y;if(n=='/')f=x/y;}cout<<"计算结果是:"<=0&&s<10){cout<<"";prime1(s);cout<3、1(s);cout<=10&&s<100){a=s/10;b=s%10;cout<<"";prime1(a);prime1(b);cout<=100&&s<4、1000){a=s/100;b=(s/10)%10;c=s%10;cout<<"";prime1(a);prime1(b);prime1(c);cout<5、prime5(c);cout<=1000&&s<10000){a=s/1000;b=(s/100)%10;c=(s/10)%10;d=s%10;cout<<"";prime1(a);prime1(b);prime1(c);prime1(d);cout<6、cout<<"";prime4(a);prime4(b);prime4(c);prime4(d);cout<=0){if(f>=0&&f<10){prime1(f);cout<=10&&f<7、100){a=f/10;b=f%10;prime1(a);prime1(b);cout<=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<8、ime2(a);prime2(b);prime2(c);cout<
3、1(s);cout<=10&&s<100){a=s/10;b=s%10;cout<<"";prime1(a);prime1(b);cout<=100&&s<
4、1000){a=s/100;b=(s/10)%10;c=s%10;cout<<"";prime1(a);prime1(b);prime1(c);cout<5、prime5(c);cout<=1000&&s<10000){a=s/1000;b=(s/100)%10;c=(s/10)%10;d=s%10;cout<<"";prime1(a);prime1(b);prime1(c);prime1(d);cout<6、cout<<"";prime4(a);prime4(b);prime4(c);prime4(d);cout<=0){if(f>=0&&f<10){prime1(f);cout<=10&&f<7、100){a=f/10;b=f%10;prime1(a);prime1(b);cout<=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<8、ime2(a);prime2(b);prime2(c);cout<
5、prime5(c);cout<=1000&&s<10000){a=s/1000;b=(s/100)%10;c=(s/10)%10;d=s%10;cout<<"";prime1(a);prime1(b);prime1(c);prime1(d);cout<6、cout<<"";prime4(a);prime4(b);prime4(c);prime4(d);cout<=0){if(f>=0&&f<10){prime1(f);cout<=10&&f<7、100){a=f/10;b=f%10;prime1(a);prime1(b);cout<=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<8、ime2(a);prime2(b);prime2(c);cout<
6、cout<<"";prime4(a);prime4(b);prime4(c);prime4(d);cout<=0){if(f>=0&&f<10){prime1(f);cout<=10&&f<
7、100){a=f/10;b=f%10;prime1(a);prime1(b);cout<=100&&f<1000){a=f/100;b=(f/10)%10;c=f%10;prime1(a);prime1(b);prime1(c);cout<8、ime2(a);prime2(b);prime2(c);cout<
8、ime2(a);prime2(b);prime2(c);cout<
此文档下载收益归作者所有