返回列表 發帖
  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>>y>>z;
  9. if(x>y&&y>z)
  10.     cout<<x<<">"<<y<<">"<<z<<endl;
  11. else if (x>z&&z>y)
  12.     cout<<x<<">"<<z<<">"<<y<<endl;
  13. else if (y>x&&x>z)
  14.     cout<<y<<">"<<x<<">"<<z<<endl;
  15. else if (y>z&&z>x)
  16.     cout<<y<<">"<<z<<">"<<x<<endl;
  17. else if (z>x&&x>y)
  18.     cout<<z<<">"<<x<<">"<<y<<endl;
  19. else if (z>y&&y>x)
  20.     cout<<z<<">"<<y<<">"<<x<<endl;
  21. else
  22.     cout<<"其中兩數或三數相等"<<endl;
  23. cout<<endl;








  24. goto re;

  25. system("pause");
  26. return 0;

  27. }
複製代碼

TOP

返回列表