返回列表 發帖
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
    int x=0,y=0,z=0;
    cin>>x;
    cin>>y;
   
    cout<<"1 x+y,2 x-y,3 x*y,4 x/y";
    cin>>z;
    if (z==1){
    cout << "x+y=" << x+y << endl;
    }
     else if(z==2){
    cout << "x-y=" << x-y << endl;
    }
      else if(z==3){
    cout << "x*y=" << x*y << endl;
    }
      else if(z==4){
    cout << "x/y=" << x/y << endl;
    }
    system("pause");
    return 0;
}

TOP

返回列表