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

TOP

返回列表