#include
using namespace std;
int main() {
int a,b,c,t;
cin >> a >> b >> c;
if ( a < b ) { t = a; a = b; b = t;}
if ( a < c ) { t = a; a = c; c = t;}
if ( b < c ) { t = b; b = c; c = t;}
cout << a << " " << b << " " << c << endl;
return 0;
}
#include
using namespace std;
main()
{
int a=3,b=5,c=7,tmp=0;
if(a {
tmp=a;
a=b;
b=tmp;
}
if(a
tmp=a;
a=c;
c=tmp;
}
if(b
tmp=b;
b=c;
c=tmp;
}
cout< system("PAUSE");
}
#include
using namespace std;
int main()
{
int a, b, c;
cout << "Enter three numbers:" << endl;
cin >> a >> b >> c;
if ( a < b)
{
// 两数交换
a ^= b;
b ^= a;
a ^= b;
}
if ( a < c)
{
a ^= c;
c ^= a;
a ^= c;
}
if ( b < c )
{
b ^= c;
c ^= b;
b ^= c;
}
cout << "The sorted are:" << endl;
cout << a << " "<< b << " " << c << endl;
return 0;
}