返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     int y;
  8.     cout<<"請輸入x:";
  9.     cin>>x;
  10.     cout<<"請輸入y:";
  11.     cin>>y;
  12.     cout<<"x="<<x<<endl;
  13.     cout<<"y="<<y<<endl;
  14.     if(x*2>y)
  15.     {
  16.            cout<<"x乘以2大於y" <<endl;   
  17.     }
  18.     if(x*2<y)
  19.     {
  20.            cout<<"x乘以2小於y" <<endl;   
  21.     }
  22.     if(x*2==y)
  23.     {
  24.            cout<<"x乘以2等於y" <<endl;   
  25.     }
  26.     system("pause");
  27.        return 0;
  28. }
複製代碼

TOP

返回列表