#include <iostream>
#include <string>
using namespace std;
int main()
{
int T, n1, n2;
string str, str1;
cin >> T;
while (T--)
{
string s = "";
string s1 = "";
cin >> n1;
cin.get();
getline(cin, str);
cin >> n2;
cin.get();
getline(cin, str1);
if (n1 != n2)
{
cout << "DIFFERENT" << endl;
continue;
}
for (int i = 0; i < str.size(); ++i)
{
if (str[i] != ' ' && str[i] - 0 < 93)
s += str[i];
}
for (int i = 0; i < str1.size(); ++i)
{
if (str1[i] != ' ' && str1[i] - 0 < 93)
s1 += str1[i];
}
if (s == s1)
cout << "SAME" << endl;
else
cout << "DIFFERENT" << endl;
}
return 0;
}
zju2947
最新推荐文章于 2021-02-02 01:36:59 发布