题解 | #提取不重复的整数#

提取不重复的整数

https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1

#include <algorithm>
#include <iostream>
#include <unordered_set>
using namespace std;

int main() {
    string str, res;
    cin >> str;
    reverse(str.begin(), str.end());

    unordered_set<char> mySet;

    for(auto c : str){
        if(mySet.count(c) == 0){
            res.append(1,c);
        }
        mySet.insert(c);
    }

    cout << res << endl;

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

全部评论

相关推荐

不愿透露姓名的神秘牛友
05-01 13:13
ecece:这么明目张胆虚报就业率啊
点赞 评论 收藏
分享
05-05 21:45
已编辑
广州大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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