- #include<iostream> //載入基本輸入/輸出工具
- #include<cstdlib> //載入基本函式庫
- using namespace std;
- int main()
- {
- int a,b;
- cout<<"請輸入a:"<<endl;
- cin>>a;
- cout<<"請輸入b:"<<endl;
- cin>>b;
- cout<<"a="<<a<<endl;
- cout<<"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; //求a 除以b 的餘數
- cout<<"Hello!"<<endl;
- system("pause"); //讓畫面暫停
- return 0; //歸零
- }
複製代碼 |