#include<cstdio>
#include<cstring>
int main(){
char str1[101], str2[101];
bool HashTable[128] = {false};
scanf("%s", str1);
scanf("%s", str2);
int len1 = strlen(str1);
int len2 = strlen(str2);
for(int i = 0; i < len1; i++){
char ch1, ch2;
int j;
for(j = 0; j < len2; j++){
ch1 = str1[i];
ch2 = str2[j];
if(ch1 >= 'a' && ch1 <= 'z') ch1 -= 32;
if(ch2 >= 'a' && ch2 <= 'z') ch2 -= 32;
if(ch1 == ch2)
break;
}
if(j == len2 && HashTable[ch1] == false){
printf("%c", ch1);
HashTable[ch1] = true;
}
}
return 0;
}
原文地址:https://www.cnblogs.com/zjsaipplp/p/10425244.html
时间: 2024-10-08 00:15:17