返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a=123,b=45;
  7.     cout<<"當a為"<<a<<",b為"<<b<<"時..."<<endl;
  8.    
  9.     cout<<"a+b="<<a+b<<endl;
  10.     cout<<"a-b="<<a-b<<endl;
  11.     cout<<"a*b="<<a*b<<endl;
  12.     cout<<"a/b="<<a/b<<endl;  //商   5/2=2..1
  13.     cout<<"a%b="<<a%b<<endl;  //餘數
  14.    
  15.     system("pause");
  16.     return 0;
  17. }
  18. 複製代碼
複製代碼

TOP

返回列表