Start: Dec, 04, 2016 12:00:00
杭州师范大学第十届程序设计竞赛—正式
End: Dec, 04, 2016 17:00:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 1ms
Memory: 1096kB
In contest: 1075

#include<stdio.h>
#include<string.h>
void main()
{
	int n;
	scanf("%d",&n);
	getchar();
	for(int b=1;b<=n;++b)
	{
		int c,f,h=0,j=0;
		char a[101];
		char k[101];
		gets(a);
		gets(k);
		c=strlen(a);
		f=strlen(k);
		for(int d=0;d<=c-1;++d)
		{
			if(a[d]==' ')
			{
				++j;
				continue;
			}
			else
			{
				for(int e=0;e<=f-1;++e)
				{
					if(k[e]==' ')
						continue;
					else if(a[d]==k[e])
					{
						k[e]='@';
						++j;
						break;
					}
				}
			}
		}
		for(int e=0;e<=f-1;++e)
		{
			if(k[e]!='@'&&k[e]!=' ')
				j+=1000;
		}
		if(j!=c)
			printf("No\n");
		else
			printf("Yes\n");
	}
}