@WangSiHan_2011
#include<iostream>
using namespace std;
int n;
string a[100], b[100];
int simlar1(string a[100], string b[100], int i) {
int simlar=0, tamp=0;
if (a[i].size() == b[i].size()) {
simlar = 1;
for (int j = 0; j < a[i].size(); j++) {
if (a[i][j] != b[i][j])tamp++;
}
if (simlar == 1 && tamp == 1)return 1;
}
else return 0;
}
int simlar2(string a[100], string b[100], int i) {
int temp=0;
if (a[i].size()-1 == b[i].size()) {
for (int j = 0; j < a[i].size();j++)
for (int v = 1; v < b[i].size(); v++) {
if (a[i][j] == b[i][v])temp++;
}
}
if (temp == b[i].size())return 1;
else return 0;
}
int simlar3(string a[100], string b[100], int i) {
int temp = 0;
if (b[i].size() - 1 == a[i].size()) {
for (int j = 0; j < b[i].size(); j++)
for (int v = 1; v < a[i].size(); v++) {
if (a[i][j] == b[i][v])temp++;
}
}
if (temp == a[i].size())return 1;
else return 0;
}
int simlar4(string a[100], string b[100], int n) {
for (int i = 0; i < n - 1; i++) {
if (a[i] == b[i])cout << "simlar" << endl;
else if (simlar3(a,b,i)==1)cout << "simlar" << endl;
else if (simlar2(a,b,i)==1)cout << "simlar" << endl;
else if (simlar1(a, b, i) == 1)cout << "simlar" << endl;
else cout << "not similar" << endl;
}
return 0;
}
int main() {
cin >> n;
for (int i = 0; i < n; i++)cin >> a[i] >> b[i];
simlar4(a, b, n);
return 0;
}