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

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

#include<stdio.h>
#include<stdlib.h> 
#include<time.h>
#define ARRAY_SIZE 26
void main()
{
	int i,m,t;
	char c;
	srand(time(NULL));
	scanf("%d",&t);
	getchar();
for(m=0;m<t;m++)
{
    int count1[ARRAY_SIZE+1]={0};
	int count2[ARRAY_SIZE+1]={0};
	for(i=0;i<100;i++)
	{
    scanf("%c",&c);
	if(c!='\n'&&c!=' ')
		++count1[c-97];
	else if(c=='\n')
		break;
	}
	for(i=0;i<100;i++)
	{
    scanf("%c",&c);
	if(c!='\n'&&c!=' ')
		++count2[c-97];
	else if(c=='\n')
		break;
	}
	int k,o;
	for(k=0;k<27;k++)
	{
	if(count1[k]==count2[k])
		o=1;
	else
	{
		o=0;
		printf("No\n");
		break;
	}
	}
	if(o==1)
	printf("Yes\n");
}
}