#include <iostream>
using namespace std;
void sort(int &,int &,int &);//进行排序
int main()
{
int inum1,inum2,inum3;
cin >> inum1 >> inum2 >> inum3;
sort(inum1,inum2,inum3);
cout << inum1 << " " << inum2 << " " << inum3 << endl;
system("pause");
return 0;
}
void sort(int &num1,int &num2,int &num3)
{
int temp;
if (num1 > num2)
{
temp = num1;
num1 = num2;
num2 = temp;
}
if(num3 < num1)
{
temp = num1;
num1 = num3;
num3 = temp;
}
else if(num3 < num2)
{
temp = num2;
num2 = num3;
num3 = temp;
}
else
{
;
}
}
|