文章
84
粉丝
408
获赞
33
访问
877.1k
#include<iostream>
#include<cstring>
#include<cstdlib>
using namespace std;
int cmp(const void* a, const void* b)
{
return (*(char*)a - *(char*)b);
}
int main()
{
char s1[105], s2[105];
int n;
cin >> n;
while (n--) {
memset(s1, 0, sizeof(s1));
memset(s2, 0, sizeof(s2));
cin >> s1 >> s2;
int len1 = 0, len2 = 0;
while (s1[len1++]);
while (s2[len2++]);
if (len1 != len2) {
cout << "No" << endl;
continue;
}
qsort(s1, len1, sizeof(s1[0]), cmp);
qsort(s2, len2, sizeof(s2[0]), cmp);
bool flag = true;
for (int i = 0 ; i < len1; i++) {
if (s1[i] != s2[i]) {
flag = false;
break;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发