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(void){
	int T,a,b,i,j,sum1,sum2;
	char s1[200],s2[200];
	scanf("%d",&T);
	getchar();
	while(T--){
		sum1=sum2=0;
		gets(s1);
		gets(s2);
		for(i=0;i<strlen(s1);i++){
			if(s1[i]==' ')
					continue;
			sum1= sum1+1;
			for(j=0;j<strlen(s2);j++){
				if(s1[i]==s2[j]){
					s2[j]='0';
				}
			}
		}
		for(j=0;j<strlen(s2);j++){
			if(s2[j]=='0')
				sum2 = sum2+1;
		}
		if(sum1==sum2)
			printf("Yes\n");
		else
			printf("No\n");
	}
	printf("\n");
	return 0;
}