题解 | #字符串排序#

字符串排序

https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723

排序+可能有重复————multiset

#include <iostream>
#include <string>
#include <set>

int main(int argc, char* argv[]){
    int n;
    std::cin >> n;
    std::multiset<std::string> dic;
    std::string str;
    while(std::cin >> str){
        dic.insert(str);
    }
    for(std::string s : dic){
        std::cout << s << std::endl;
    }
    return 0;
}
全部评论

相关推荐

05-14 20:34
门头沟学院 Java
窝补药贝八股:管他们,乱说,反正又不去,直接说680
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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