#include<iostream>
using namespace std;
int asending(int &x,int &y);
int main()
{
cout<<"输入数字x=: ";
int x;
cin>>x;
cout<<"输入数字y=: ";
int y;
cin>>y;
cout<<"输入数字z=: ";
int z;
cin>>z;
while(asending(x,y)==0){
if(z<=x)
cout<<z<<" "<<x<<" "<<y<<endl;
else if(z>x&&z<=y)
cout<<x<<" "<<z<<" "<<y<<endl;
else if(z>y)
cout<<x<<" "<<y<<" "<<z<<endl;
break;
}
return 0;
}
int asending(int &x,int &y)
{
if(x<=y)
return 0;
else{
int temp=x;
x=y;
y=temp;
return 1;
}
}

浙公网安备 33010602011771号