- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x = 29;
- int y = 2;
- cout << "當 x = " << x << ", y = " << 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;
- }
複製代碼 |