#include <iostream> using namespace std; int FX (int *x,int *y,int *z); int main() { int a,b,c; cin>>a>>b>>c; FX(&a,&b,&c); return 0; } int FX (int *x,int *y,int *z) { if(*x>*y&&*y>*z) cout<<*x<<" "<<*y<<" "<<*z<<endl; else if (*x>*z&&*z>*y) cout<<*x<<" "<<*z<<" "<<*y<<endl; else if (*y>*x&&*x>*z) cout<<*y<<" "<<*x<<" "<<*z<<endl; else if (*y>*z&&*z>*x) cout<<*y<<" "<<*z<<" "<<*x<<endl; else if (*z>*y&&*y>*x) cout<<*z<<" "<<*y<<" "<<*x<<endl; else if(*z>*x&&*x>*y) cout<<*z<<" "<<*x<<" "<<*y<<endl; }
原文:http://www.cnblogs.com/lcchuguo/p/5118645.html