A1050 String Subtraction

A1050 String Subtraction_第1张图片

Sample Input:

They are students.
aeiou

Sample Output:

Thy r stdnts.

solution

#include 
#include 
int main(){
	char s1[10005], s2[10005];
	int hash[130] = {0};
	gets(s1);
	gets(s2);
	for(int i = 0; i < strlen(s2); i++)
		hash[s2[i]]++;
	for(int j = 0; j < strlen(s1); j++){
		if(!hash[s1[j]]) printf("%c", s1[j]);
	}
	return 0;
} 

你可能感兴趣的:(甲级,pat,哈希算法,算法)