题解 | #图片整理#

图片整理

https://www.nowcoder.com/practice/2de4127fda5e46858aa85d254af43941

#include<bits/stdc++.h>

using namespace std;


void printSet(multiset<char>& s) {
    for (multiset<char>::iterator it = s.begin(); it != s.end(); it++) {
        cout << *it ;
    }
    cout << endl;
}
int main() {
    multiset<char>s1;
    string str;
    cin >> str;
    for(int i =0;i<str.length();i++){
        s1.insert(str[i]);
    }



    printSet(s1);


}
// 64 位输出请用 printf("%lld")

所有元素都会在插入时自动被排序

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务