#include <stdio.h>
#include<conio.h>
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
for(;;){
cout<<"欢迎来到加减乘除四则运算,";
cout<<"请按任意键继续";
getch();
system("cls");
for(int i=0;i<=12;i++){
cout<<"-";
}
cout<<endl;
cout<<"| 1.加法运算|\n";
cout<<"| 2.减法运算|\n";
cout<<"| 3.乘法运算|\n";
cout<<"| 4.除法运算|\n";
cout<<"| 5.退出运算|\n";
for(int i=0;i<=12;i++)
{
cout<<"-";
}
cout<<endl;
int a;
cin>>a;
system("cls");
int o,t;
if(a==1){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"+"<<t<<"="<<o+t;
cout<<endl;
}else if(a==2){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"-"<<t<<"="<<o-t;
cout<<endl;
}else if(a==3){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"*"<<t<<"="<<o*t;
cout<<endl;
}else if(a==4){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"/"<<t<<"="<<o/t;
cout<<endl;
}else{
cout<<"十分的感谢您,再见!";
break;
}
}
return 0;
}
#include<conio.h>
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
for(;;){
cout<<"欢迎来到加减乘除四则运算,";
cout<<"请按任意键继续";
getch();
system("cls");
for(int i=0;i<=12;i++){
cout<<"-";
}
cout<<endl;
cout<<"| 1.加法运算|\n";
cout<<"| 2.减法运算|\n";
cout<<"| 3.乘法运算|\n";
cout<<"| 4.除法运算|\n";
cout<<"| 5.退出运算|\n";
for(int i=0;i<=12;i++)
{
cout<<"-";
}
cout<<endl;
int a;
cin>>a;
system("cls");
int o,t;
if(a==1){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"+"<<t<<"="<<o+t;
cout<<endl;
}else if(a==2){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"-"<<t<<"="<<o-t;
cout<<endl;
}else if(a==3){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"*"<<t<<"="<<o*t;
cout<<endl;
}else if(a==4){
cout<<"请输入两个数:";
cin>>o>>t;
system("cls");
cout<<o<<"/"<<t<<"="<<o/t;
cout<<endl;
}else{
cout<<"十分的感谢您,再见!";
break;
}
}
return 0;
}