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

TOP

返回列表