1.9

来源:互联网 发布:耐克淘宝旗舰店 编辑:程序博客网 时间:2024/05/02 02:32
#include<iostream>using namespace std;void paixu(int &x, int &y,int &z){    int temp;    if(x>y)    {temp=y;y=x;x=temp;};    if(x>z)    {temp=z;z=x;x=temp;};    if(y>z)    {temp=y;y=z;z=temp;};}void main(){    int a,b,c;    cout<<"请输入3个数字:"<<endl;    cin>>a>>b>>c;    paixu(a,b,c);    cout<<a<<" "<<b<<" "<<c<<endl;}

0 0
原创粉丝点击