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

TOP

返回列表