本帖最後由 顏詢 於 2017-11-13 20:19 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int num1= 0 ;
- int num2= 0 ;
- cout<<"請輸入數字"<<endl;
- cin>>num1;
- cout<<"請輸入數字"<<endl;
- cin>>num2;
-
-
- 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;
- }
複製代碼 |