- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int x = 21;
- int y = 5;
- 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;
- cout << "這就是x和y的加減乘除和餘數的運算~" << endl;
- system("pause");
- return 0;
- }
複製代碼 |