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