返回列表 發帖
  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.   cout<<"您輸入的x為"<<x<<",y為"<<y<<endl;
  12.   if(x>y)
  13.   {
  14.   cout<<"x大於Y"<<endl;
  15.   }
  16.   else if(x<y)
  17.   {
  18.    cout<<"x小於Y"<<endl;   
  19.   }
  20.   else
  21.   {
  22.   cout<<"x等於y"<<endl;   
  23.   }
  24.   system("pause");
  25.   return 0;      
  26. }
複製代碼

TOP

返回列表