#include <iostream> #include <iomanip> using namespace std;
void swp(int* a, int* b) { int c; c=*a; *a=*b; *b=c; }
int main() { int a,b,c,d; cout<<"input a b c "; cin>>a>>b>>c; if (b<a) swp(&a,&b); if (c<a) swp(&a,&c); if (c<b) swp(&b,&c); cout<<a<<" "<<b<<" "<<c<<endl; system("pause"); return 0; }
#include <iomanip>
using namespace std;
void swp(int* a, int* b) {
int c;
c=*a; *a=*b; *b=c;
}
int main() {
int a,b,c,d;
cout<<"input a b c "; cin>>a>>b>>c;
if (b<a) swp(&a,&b);
if (c<a) swp(&a,&c);
if (c<b) swp(&b,&c);
cout<<a<<" "<<b<<" "<<c<<endl;
system("pause");
return 0;
}