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,i,j;
	scanf("%d",&t);
	getchar();
	while(t--){
	int temp=1;
	char a[101],b[101];
	gets(a);
	gets(b);
	int l1=strlen(b),l2=strlen(a);
	for(i=0;i<l1;i++){
		if(b[i]==' ')
			continue;
	for(j=0;j<l2;j++){
		if(a[j]==b[i]){
			a[j]='\0';
			break;}
	}
	if(j==l2&&a[j]!=b[i]){
		temp=0;
		break;}
	}
	for(i=0;i<l2;i++){
		if(a[i]==' '||a[i]=='\0')
			1+1;
		else temp=0;
	}
	if(temp)
		printf("Yes\n");
	else
		printf("No\n");
	}
	return 0;
}