#include<iostream>
using namespace std;
void paixu(int &x, int &y,int &z)
{
int temp;
if(x>y)
{temp=y;y=x;x=temp;};
if(x>z)
{temp=z;z=x;x=temp;};
if(y>z)
{temp=y;y=z;z=temp;};
}
void main()
{
int a,b,c;
cout<<"请输入3个数字:"<<endl;
cin>>a>>b>>c;
paixu(a,b,c);
cout<<a<<" "<<b<<" "<<c<<endl;
}
1.9
最新推荐文章于 2022-11-08 23:12:14 发布