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 n,i,q1,w1,e1,r1,t1,y1,u1,i1,o1,p1,a1,s1,d1,f1,g1,h1,j1,k1,l1,z1,x1,c1,v1,b1,n1,m1;
	int q2,w2,e2,r2,t2,y2,u2,i2,o2,p2,a2,s2,d2,f2,g2,h2,j2,k2,l2,z2,x2,c2,v2,b2,n2,m2;
	int l;
	char c[100];
	char d[100];
	scanf("%d",&n);getchar();
	while(n--)
	{
    q1=0,w1=0,e1=0,r1=0,t1=0,y1=0,u1=0,i1=0,o1=0,p1=0,a1=0,s1=0,d1=0,f1=0,g1=0,h1=0,j1=0,k1=0,l1=0,z1=0,x1=0,c1=0,v1=0,b1=0,n1=0,m1=0;
	q2=0,w2=0,e2=0,r2=0,t2=0,y2=0,u2=0,i2=0,o2=0,p2=0,a2=0,s2=0,d2=0,f2=0,g2=0,h2=0,j2=0,k2=0,l2=0,z2=0,x2=0,c2=0,v2=0,b2=0,n2=0,m2=0;
	
	gets(c);
	gets(d);
	l=strlen(c);
    for(i=0;i<l;i++)
	{
		if(c[i]=='q'){q1++;}
		if(c[i]=='w'){w1++;}
		if(c[i]=='e'){e1++;}
		if(c[i]=='r'){r1++;}
		if(c[i]=='t'){t1++;}
		if(c[i]=='y'){y1++;}
		if(c[i]=='u'){u1++;}
		if(c[i]=='i'){i1++;}
		if(c[i]=='o'){o1++;}
		if(c[i]=='p'){p1++;}
		if(c[i]=='a'){a1++;}
		if(c[i]=='s'){s1++;}
		if(c[i]=='d'){d1++;}
		if(c[i]=='f'){f1++;}
		if(c[i]=='g'){g1++;}
		if(c[i]=='h'){h1++;}
		if(c[i]=='j'){j1++;}
		if(c[i]=='k'){k1++;}
		if(c[i]=='l'){l1++;}
		if(c[i]=='z'){z1++;}
		if(c[i]=='x'){x1++;}
		if(c[i]=='c'){c1++;}
		if(c[i]=='v'){v1++;}
		if(c[i]=='b'){b1++;}
		if(c[i]=='n'){n1++;}
		if(c[i]=='m'){m1++;}
	}
	 for(i=0;i<l;i++)
	{
		if(d[i]=='q'){q2++;}
		if(d[i]=='w'){w2++;}
		if(d[i]=='e'){e2++;}
		if(d[i]=='r'){r2++;}
		if(d[i]=='t'){t2++;}
		if(d[i]=='y'){y2++;}
		if(d[i]=='u'){u2++;}
		if(d[i]=='i'){i2++;}
		if(d[i]=='o'){o2++;}
		if(d[i]=='p'){p2++;}
		if(d[i]=='a'){a2++;}
		if(d[i]=='s'){s2++;}
		if(d[i]=='d'){d2++;}
		if(d[i]=='f'){f2++;}
		if(d[i]=='g'){g2++;}
		if(d[i]=='h'){h2++;}
		if(d[i]=='j'){j2++;}
		if(d[i]=='k'){k2++;}
		if(d[i]=='l'){l2++;}
		if(d[i]=='z'){z2++;}
		if(d[i]=='x'){x2++;}
		if(d[i]=='c'){c2++;}
		if(d[i]=='v'){v2++;}
		if(d[i]=='b'){b2++;}
		if(d[i]=='n'){n2++;}
		if(d[i]=='m'){m2++;}
	}
	//printf("%s\n",c);
	//printf("%s\n",d);

	if(q1==q2&&w1==w2&&e1==e2&&r1==r2&&t1==t2&&y1==y2&&u1==u2&&i1==i2&&o1==o2&&p1==p2
		&&a1==a2&&s1==s2&&d1==d2&&f1==f2&&g1==g2&&h1==h2&&j1==j2&&k1==k2&&l1==l2&&
		z1==z2&&x1==x2&&c1==c2&&v1==v2&&b1==b2&&n1==n2&&m1==m2)
	{
		printf("Yes\n");
	}
	else
		printf("No\n");
	
	}
	return 0;
}