#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
int i;
cin >> n;
getchar();
string a, b;
int p, q;
int tag = 0;
getline(cin, a);
for (i = 0; i < n - 1; i++)
{
getline(cin, b);
p = a.size() - 1;
q = b.size() - 1;
while (p>=0&&q>=0&&a[p] == b[q] && p >= tag)
{
p--; q--;
}
tag = p + 1;
}
p++;
if (p >= a.size() - 1)
cout << "nai" << endl;
else
{
while (p <= a.size() - 1)
{
cout << a[p];
p++;
}
cout << endl;
}
system("pause");
return 0;
}
PAT A1077 Kuchiguse(测试点4未过)
最新推荐文章于 2020-05-09 08:51:28 发布