PAT 甲级 A1050 (2019/02/19)

#include<cstdio>
#include<cstring>
char str1[10010], str2[10010]; 
bool HashTable[128];
int main(){
    fgets(str1,10010,stdin);
    fgets(str2,10010,stdin);
    int len1 = strlen(str1);
    int len2 = strlen(str2);
    for(int i = 0; i < len2; i++){
        HashTable[str2[i]] = true; 
    }
    for(int j = 0; j < len1; j++){
        if(HashTable[str1[j]] == false){
            printf("%c", str1[j]);
        }
    }
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/zjsaipplp/p/10425241.html