本帖最後由 蕭澧邦 於 2016-11-23 17:25 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int z, x, y;
- cout<<"請依序輸入三個數: ";
- cin>>x>>y>>z;
-
- if(x>y && y>z)
- {
- cout<<x<<">"<<y<<">"<<z<<endl;
- }else if(x>z && z>y)
- {
- cout<<x<<">"<<z<<">"<<x<<endl;
- }else if(y>x && x>z)
- {
- cout<<y<<">"<<x<<">"<<z<<endl;
- }else if(y>z && z>x)
- {
- cout<<y<<">"<<z<<">"<<x<<endl;
- }else if(z>x && x>y)
- {
- cout<<z<<">"<<x<<">"<<y<<endl;
- }else
- {
- cout<<z<<">"<<y<<">"<<x<<endl;
- }
- goto re;
-
- system("pause");
- return 0;
- }
複製代碼 |