- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main(){
- int a, b;
- cout << "請輸入a和b:";
- cin >> a >> b;
- cout << "當a等於" << a << ",b等於" << b << "時" << endl;
-
- cout << "a + b =" << a + b << endl;
- cout << "a - b =" << a - b << endl;
- cout << "a * b =" << a * b << endl;
- cout << "a / b =" << a / b << endl;
- cout << "a % b =" << a % b << endl;
-
- system("pause");
- return 0;
- }
複製代碼 |