#include<iostream>
#include<stdlib.h>
#include<math.h>
using namespace std;
int main()
{
int n; int a; int b; int c;
cout << " 1.加法运算\n";
cout << " 2.减法运算\n";
cout << " 3.乘法运算\n";
cout << " 4.除法运算\n";
cout << "Please select a type:\n";
cin >> n;
if (n = 1)
{
cout << "请输入两个数:\n";
cin >> a;
cin >> b;
c = a + b;
cout << "c=" << c << endl;
}
if (n = 2)
{
cout << "请输入两个数:\n";
cin >> a;
cin >> b;
c = a - b;
cout << "c=" << c << endl;
}
if (n = 3)
{
cout << "请输入两个数:\n";
cin >> a;
cin >> b;
c = a * b;
cout << "c=" << c << endl;
}
if (n = 4)
{
cout << "请输入两个数:\n";
cin >> a;
cin >> b;
c = a / b;
cout << "c=" << c << endl;
}
system("pause");
}
AAnonymous
相关分类