- #include<iostream>
- using namespace std;
- int main()
- {
- int x;
- int y;
- cout<<"請輸入x值:";
- cin>>x;
- cout<<endl;
- cout<<"請輸入y值:";
- cin>>y;
- cout<<"您剛輸入的x是:"<<x<<endl;
- cout<<"您剛輸入的y為:"<<y<<endl;
- cout<<"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;
- cout<<"x%y="<<x%y<<endl;
- system("pause");
- return 0;
- }
複製代碼 |