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