/*
* 程序的版权和版本声明部分
* Copyright (c)2012, 烟台大学计算机学院学生
* All rightsreserved.
* 文件名称: Cpp1.cpp
* 作 者:杨晨
* 完成日期:2012年12月20日
* 版本号: v1.0
* 输入描述:无
* 问题描述:无
*/
#include <iostream>
using namespace std;
void paixu(int &x,int &y,int &z);
int main ()
{
int a,b,c;
cin>>a>>b>>c;
paixu(a,b,c);
return 0;
}
void paixu(int &x,int &y,int &z)
{
if(x>=y)
{
if(y>=z)
cout<<"由大到小为"<<x<<y<<z<<endl;
else{
if(z>=x)
cout<<"由大到小为"<<z<<x<<y<<endl;
if(z<x)
cout<<"由大到小为"<<x<<z<<y<<endl;
}
}
if(x<y)
{ if(x>=z)
cout<<"由大到小为"<<y<<x<<z<<endl;
else{
if(z>=y)
cout<<"由大到小为"<<z<<y<<x<<endl;
if(z<y)
cout<<"由大到小为"<<y<<z<<x<<endl;
}
}
}
输出结果: