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: 1092kB
In contest: 1075

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	char sb[101];
	int a[26] = {0}, b[26] = {0}, i, j, t;
	char ch;
	scanf("%d%*c", &t);
	while(t--)
	{
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		while (scanf("%c", &ch), ch != '\n')
		{
			if (ch != ' ')
			{
				a[ch - 97]++;
			}
		}
		while (scanf("%c", &ch) != -1 && ch != '\n')
		{
			if (ch != ' ')
			{
				b[ch - 97]++;
			}
		}
		j = 1;
		for (i = 0; i < 26; i++)
		{
			if (a[i] != b[i])
			{
				j = 0;
				break;
			}
		}
		if (j)
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
}