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(){
	char ch1[101],ch2[102];
	int j,i,t,a[27],b[27],flag;
	scanf("%d",&t);
	getchar();
	while(t--){
		flag=1;
		for(i=0;i<27;i++){
		a[i]=0;
		b[i]=0;
		}
	gets(ch1);
	gets(ch2);
	for(i=0;i<strlen(ch1);i++){
		a[ch1[i]-'a']++;
	}
	for(i=0;i<strlen(ch2);i++){
		b[ch2[i]-'a']++;
	}
	for(i=0;i<27;i++){
		if(a[i]!=b[i]){
		flag=0;
		}
	}

	if(flag)printf("Yes\n");
	else printf("No\n");
	}
return 0;
}