返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    
  7.     int  x;
  8.     cout<<"請輸入一個整數:";
  9.     cin>>x;
  10.     cout<<"您輸入的數字是:"<<x<<endl;
  11.    
  12.     system("pause");
  13.     return 0;
  14. }
複製代碼

TOP

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

TOP

返回列表