题解 | #去除字符串中重复的字符#

去除字符串中重复的字符

https://www.nowcoder.com/practice/ffaf8888a89a4bbab80767d18b401a26

#include <iostream>
// write your code here......
#include<set>
using namespace std;

int main() {

    char str[100] = { 0 };
    cin.getline(str, sizeof(str));

    // write your code here......
    set<char> a;
    a.insert(str,str+99);
    set<char> ::iterator it =a.begin();
    for(;it!=a.end();it++)
    {
        if(*it!=0)
        {
        cout <<*it;
        }
    }
    
    return 0;
}

全部评论

相关推荐

林后润:听说他们有kpi,要到了简历编号就不理人了
27届求职交流
点赞 评论 收藏
分享
代码飞升AL:同学院本建议你换一个项目 就算你不去特意搜也应该知道点评不能写吧 保持投递不要停 然后快速弄一个项目换上去 公司就别挑了 我第一段120一天 快速跳就行
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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