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

TOP

返回列表