- #include<iostream> //輸入輸出
- #include<cstdlib> //函式庫
- using namespace std;
- int main()
- {
- int num1 = 7;
- int num2 = 5;
-
- cout << num1 << " + " << num2 << " = " << num1+num2 << endl; //變數相加
- cout << num1 << " - " << num2 << " = " << num1-num2 << endl;
- cout << num1 << " * " << num2 << " = " << num1*num2 << endl;
- cout << num1 << " / " << num2 << " = " << num1/num2 << endl;
- cout << num1 << " % " << num2 << " = " << num1%num2 << endl;
-
- system("pause");
- return 0;
- }
複製代碼 |