返回列表 發帖
本帖最後由 林彥廷 於 2020-7-16 14:46 編輯
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {  
  6.     int  a;
  7.     cout<<"請輸入一數:";
  8.     cin>>a;
  9.     count<<"您輸入的數字是"<<a<<endl;
  10.    
  11.     system("pause");
  12.     return 0;
  13. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      int x,y;
  7.      
  8.      
  9.      cout<<"請輸入一整數x:";
  10.      cin>> x;
  11.      cout<<"請輸入一整數y:";
  12.      cin>> y;
  13.    
  14.    
  15.     cout<<"x+y="<<x+y<<endl;
  16.     cout<<"x-y="<<x-y<<endl;
  17.     cout<<"x*y="<<x*y<<endl;
  18.     cout<<"x/y="<<x/y<<endl;
  19.     cout<<"x%y="<<x%y<<endl;
  20.     system("pause");
  21.     return 0;
  22. }
複製代碼

TOP

返回列表