1050. String Subtraction (20)

#include <iostream>
#include <string.h>

using namespace std;

int flag[130];
char s[2][10010];

int main()
{
	int i, len[2];
	for(i = 0; i <= 1; i++)
	{
		gets(s[i]);
		len[i] = strlen(s[i]);
	}

	for(i = 0; i < len[1]; i++)
	{
		flag[s[1][i]] = 1;
	}

	char ch;
	for(i = 0; i < len[0]; i++)
	{
		ch = s[0][i];
		if(flag[ch] == 0)
		{
			printf("%c", ch);
		}
	}

	printf("\n");

	system("pause");
	return 0;
}

 

posted on 2025-11-23 17:08  王景迁  阅读(0)  评论(0)    收藏  举报

导航