返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main (){
  5.     int x ,y, z;
  6.     re:
  7. cout<<"請依序輸入三數";
  8. cin>>x;
  9. cin>>y;
  10. cin>>z;

  11. if(x>y&&y>z)
  12.     cout<<x<<">"<<y<<">"<<z<<endl;
  13. else if(x>z&&z>y)
  14.     cout<<x<<">"<<z<<">"<<y<<endl;
  15. else if(y>x&&x>z)
  16.     cout<<y<<">"<<x<<">"<<z<<endl;
  17. else if(y>z&&z>x)
  18.     cout<<y<<">"<<z<<">"<<x<<endl;
  19. else if(z>x&&x>y)
  20.     cout<<z<<">"<<x<<">"<<y<<endl;
  21. else if(z>y&&y>x)
  22.     cout<<z<<">"<<y<<">"<<x<<endl;
  23. else if(x==y&&x>z)
  24.     cout<<x<<"="<<x<<">"<<z<<endl;
  25. else if(x==y&&y<z)
  26.     cout<<z<<">"<<x<<"="<<x<<endl;
  27. else if(x==z&&z<y)
  28.     cout<<y<<">"<<z<<"="<<z<<endl;
  29. else if(x==z&&z>y)
  30.     cout<<z<<"="<<z<<">"<<y<<endl;
  31. else if(y==z&&z>x)
  32.     cout<<z<<"="<<z<<">"<<x<<endl;
  33. else if(y==z&&z<x)
  34.     cout<<x<<">"<<z<<"="<<z<<endl;
  35. else if(x==y&&y==z)
  36.     cout<<z<<"="<<z<<"="<<z<<endl;
  37. else
  38.     cout<<"輸入錯誤"<<endl;

  39.     cout<<endl;

  40. goto re;


  41. system("pause");
  42. return 0;

  43. }
複製代碼

TOP

返回列表