PAT甲级1050题(去重子串)


1.题目介绍

1050
1050

2.考察点,难度

字符串处理类,字符串字符统计count函数,难度易

3.解题代码

c
#include <bits/stdc++.h>
using namespace std;

int main(){

    // freopen("D:\\PAT\\Clion\\in.txt","r",stdin);

    string x,y,s="";
    getline(cin,x);
    getline(cin,y);
    for(int i=0;i<x.length();i++){
        if(count(y.begin(),y.end(),x[i])!=0){
            continue;
        }
        s+=x[i];
    }
    cout<<s<<endl;
    return 0;
}

4.原题地址

https://pintia.cn/problem-sets/994805342720868352/problems/994805429018673152


文章作者: Peyton
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Peyton !