1 条题解

  • 1
    @ 2021-11-2 22:41:36
    #include<iostream>
    using namespace std;
    const int Num = 1e6 + 5;
    string s = "";
    string strsort(string str){
        int len = str.size();
        for(int i = 0; i < len; i++)
            for(int j = len - 1; j >= i; j--)
                if(str[j-1] > str[j])
                    swap(str[j-1], str[j]);
        return str;
    }
    int main(){
        cin >> s;
        cout << strsort(s);
        return 0;
        /*防复制
    }/
    

    冒泡排序就好了,不用STL

    • 1

    信息

    ID
    1426
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    递交数
    80
    已通过
    29
    上传者