文章
13
粉丝
120
获赞
1
访问
6.4k
#include <stdio.h>
#include <string.h>
int main()
{
int n;
scanf("%d", &n);
while (n--)
{
char a[1000], b[1000];
int a1[26] = {0}, b1[26] = {0};
scanf("%s %s", a, b);
int lena = strlen(a), lenb = strlen(b), flag = 1;
if (lena != lenb)
flag = 0;
for (int i = 0; i < lena && flag; i++)
a1[a[i] - 'a']++;
for (int i = 0; i < lenb && flag; i++)
b1[b[i] - 'a']++;
for (int i = 0; i < 26; i++)
{
if (a1[i] != b1[i])
{
flag = 0;
break;
}
}
if (flag)
printf("Yes\n");
else
printf("No\n");
}
}
登录后发布评论
暂无评论,来抢沙发