还挺容易的这题(开心
#include<iostream>
#include<string>
using namespace std;
int main() {
string n; getline(cin, n);
int N = stoi(n);
string result;
getline(cin, result);
for (int i = 2; i <= N; i++) {
string temp;
getline(cin, temp);
int k = 0;
while (k < result.size()) {
if (result[result.size() -1- k] != temp[temp.size() -1- k])
break;
k++;
}
result.erase(0, result.size() - k);
if (result.size() == 0) {
cout << "nai";
return 0;
}
}
cout << result;
return 0;
}