返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    int x;
  6.    int z;
  7.   
  8.    
  9.    cout<<"請輸入兩個數字電腦會幫您排列數字的大小"<<endl;
  10.    cout<<"請輸入第一個數"<<endl;
  11.    cin>>x;
  12.    cout<<"請輸入第二個數"<<endl;
  13.    cin>>z;
  14.    
  15.    if(x>z)
  16.       {
  17.             cout<<x<<">"<<z<<endl;
  18.       }
  19.    else if(x>z)
  20.       {
  21.             cout<<x<<">"<<z<<endl;
  22.       }
  23.    else if(z>x)
  24.       {
  25.              cout<<z<<">"<<x<<endl;
  26.       }
  27.    else if(z=x)
  28.       {
  29.              cout<<z<<"="<<x<<endl;
  30.       }  
  31.    
  32.    system("pause");
  33.    return 0;   
  34. }
複製代碼

TOP

返回列表