- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int x,y,z;
- cout<<"請輸入第一個數";
- cin>>x;
- cout<<"請輸入第二個數";
- cin>>y;
- cout<<"請輸入第三個數";
- cin>>z;
- if(x>y&&y>z){
- cout<<x<<">"<<y<<">"<<z<<endl;
- goto re;}
- else if(x>z&&z>y){
- cout<<x<<">"<<z<<">"<<y<<endl;
- goto re;}
- else if(y>x&&x>z){
- cout<<y<<">"<<x<<">"<<z<<endl;
- goto re;}
- else if(y>z&&z>x){
- cout<<y<<">"<<z<<">"<<x<<endl;
- goto re;}
- else if(z>x&&x>y){
- cout<<z<<">"<<x<<">"<<y<<endl;
- goto re;}
- else if(z>y&&y>x){
- cout<<z<<">"<<y<<">"<<x<<endl;
- goto re;}
- else if(x==y&&x>z){
- cout<<x<<"="<<x<<">"<<z<<endl;
- goto re;}
- else if(x==y&&y<z){
- cout<<z<<">"<<x<<"="<<x<<endl;
- goto re;}
- else if(x==z&&z<y){
- cout<<y<<">"<<z<<"="<<z<<endl;
- goto re;}
- else if(x==z&&z>y){
- cout<<z<<"="<<z<<">"<<y<<endl;
- goto re;}
- else if(y==z&&z>x){
- cout<<z<<"="<<z<<">"<<x<<endl;
- goto re;}
- else if(y==z&&z<x){
- cout<<x<<">"<<z<<"="<<z<<endl;
- goto re;}
- else(x==y&&y==z);{
- cout<<z<<"="<<z<<"="<<z<<endl;
- goto re;}
- system("pause");
- return 0;
- }
複製代碼 |