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>
int main(){
	int n,count1[26]={0},count2[26]={0};
	scanf("%d",&n);
	getchar();
	while(n--){
		char a[101]={""},b[101]={""};
	gets(a);
	gets(b);
	int i,j;
	for(i=0;i<strlen(a);i++){
		switch(a[i]){
		case 'a':count1[0]++;break;
		case 'b':count1[1]++;break;
		case 'c':count1[2]++;break;
		case 'd':count1[3]++;break;
		case 'e':count1[4]++;break;
		case 'f':count1[5]++;break;
		case 'g':count1[6]++;break;
		case 'h':count1[7]++;break;
		case 'i':count1[8]++;break;
		case 'j':count1[9]++;break;
		case 'k':count1[10]++;break;
		case 'l':count1[11]++;break;
		case 'm':count1[12]++;break;
		case 'n':count1[13]++;break;
		case 'o':count1[14]++;break;
		case 'p':count1[15]++;break;
		case 'q':count1[16]++;break;
		case 'r':count1[17]++;break;
		case 's':count1[18]++;break;
		case 't':count1[19]++;break;
		case 'u':count1[20]++;break;
		case 'v':count1[21]++;break;
		case 'w':count1[22]++;break;
		case 'x':count1[23]++;break;
		case 'y':count1[24]++;break;
		case 'z':count1[25]++;break;
		case ' ':continue;break;
		}
	}
	for(j=0;j<strlen(b);j++){
		switch(b[j]){
		case 'a':count2[0]++;break;
		case 'b':count2[1]++;break;
		case 'c':count2[2]++;break;
		case 'd':count2[3]++;break;
		case 'e':count2[4]++;break;
		case 'f':count2[5]++;break;
		case 'g':count2[6]++;break;
		case 'h':count2[7]++;break;
		case 'i':count2[8]++;break;
		case 'j':count2[9]++;break;
		case 'k':count2[10]++;break;
		case 'l':count2[11]++;break;
		case 'm':count2[12]++;break;
		case 'n':count2[13]++;break;
		case 'o':count2[14]++;break;
		case 'p':count2[15]++;break;
		case 'q':count2[16]++;break;
		case 'r':count2[17]++;break;
		case 's':count2[18]++;break;
		case 't':count2[19]++;break;
		case 'u':count2[20]++;break;
		case 'v':count2[21]++;break;
		case 'w':count2[22]++;break;
		case 'x':count2[23]++;break;
		case 'y':count2[24]++;break;
		case 'z':count2[25]++;break;
		case ' ':continue;break;
		}
	}
	int flag=1;
	for(i=0;i<26;i++)
	{
		if(count1[i]!=count2[i])
			flag=0;
	}
	if(flag)
		printf("Yes\n");
	else
		printf("No\n");
	for(i=0;i<26;i++)
	{
	count1[i]=0;
	count2[i]=0;
	}
	}
	return 0;
}