返回列表 發帖
#include<cstdlib>
using namespace std;
int main()
{
   
   
    int x;int y;
    cout<<"兩數的五則運算"<<endl;
    cout<<"x"<<endl;
    cin>>x;
    cout<<"y"<<endl;
    cin>>y;
   
    if(x==0||y==0)
    {
     cout<<"請重新輸入" <<endl;   
    }
    else{
    cout<<"x+y"<<x+y <<endl;
    cout<<"x-y"<<x-y <<endl;
    cout<<"x*y"<<x*y <<endl;
    cout<<"x/y"<<x/y <<endl;
    cout<<"x%y"<<x%y <<endl;
    system("pause");
    return 0;   }
    }

TOP

返回列表