- #include<iostream> // <-基本輸出輸入的函式庫 Input Output cin 輸入 cout 輸出
- #include<cstdlib> //主要的函式庫 Library
- using namespace std;
- int main()
- {
- int x; int y;
- cout << "兩數的五則運算" <<endl;
- cout << "請輸入x的值:" <<endl;
- cin >> x;
- cout << "請輸入y的值:" <<endl;
- cin >> y;
- 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;
- }
複製代碼 |