4 条题解

  • 4

    #include<iostream>
    #include<cmath>
    using namespace std;
    int main( )
    {
    int a,b,c;
    cin>>a>>b>>c;
    if(a>b)
    if(b>c)
    cout<<a<<" "<<b<<" "<<c;
    else if(c>a)
    cout<<c<<" "<<a<<" "<<b;
    else
    cout<<a<<" "<<c<<" "<<b;
    else
    if(a>c)
    cout<<b<<" "<<a<<" "<<c;
    else if(c>b)
    cout<<c<<" "<<b<<" "<<a;
    else
    cout<<b<<" "<<c<<" "<<a;
    return 0;
    }

  • 1

    #include<iostream>
    #include<cmath>
    using namespace std;
    int main()
    {
    int a,b,c;
    cin>>a>>b>>c;
    if(a<b)
    if(c<a)
    cout<<b<<' '<<a<<' '<<c<<endl;
    else
    if(b<c)
    cout<<c<<' '<<b<<' '<<a<<endl;
    else
    cout<<b<<' '<<c<<' '<<a<<endl;

    else
    if(c<b)
    cout<<a<<' '<<b<<' '<<c<<endl;
    else
    if(a<c)
    cout<<c<<' '<<a<<' '<<b<<endl;
    else
    cout<<a<<' '<<c<<' '<<b<<endl;
    return 0;
    }
    //👍👍

  • 0
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int x,y,z,s;
        cin>>x>>y>>z;
        if(x<y)
        {
            s=y;
            y=x;
            x=s;
        }
        if(x<z)
        {
            s=z;
            z=x;
            x=s;
        }
        if(y<z)
        {
            s=z;
            z=y;
            y=s;
        }
        cout<<x<<' '<<y<<' '<<z<<endl;
        return 0;
    }
    
    
  • 0
    @ 2023-05-23 21:42:19

    #include<iostream>
    #include<cmath>
    using namespace std;
    int main( )
    {
    int a,b,c;
    cin>>a>>b>>c;
    if(a>b)
    if(b>c)
    cout<<a<<" "<<b<<" "<<c;
    else if(c>a)
    cout<<c<<" "<<a<<" "<<b;
    else
    cout<<a<<" "<<c<<" "<<b;
    else
    if(a>c)
    cout<<b<<" "<<a<<" "<<c;
    else if(c>b)
    cout<<c<<" "<<b<<" "<<a;
    else
    cout<<b<<" "<<c<<" "<<a;
    return 0;
    }*好像只有这种方法...*

  • 1

信息

ID
1707
难度
1
分类
(无)
标签
递交数
186
已通过
115
通过率
62%
被复制
2
上传者