#include <iostream>
#include <vector>
#include <sstream>
using namespace std; int n;
string c[100];
string res;
int fir=1;
int ok=0;
string line;
int main()
{
cin>>n;
getline(cin,line);
for(int i=0;i<n;i++){
ok=0;
getline(cin,line);
c[i]=line;
int p=res.size()-1,q=c[i].size()-1;
while(p>=0&&q>=0){
if(res[p]==c[i][q]){
p--;q--;
}else{
break;
}
}
if(fir){
res=c[i];
fir=0;
}else{
res=c[i].substr(q+1);
}
}
if(res.size()==0) cout<<"nai"<<endl;
else cout<<res;
return 0;
}

  

PAT1077. Kuchiguse (20)的更多相关文章

  1. PAT1077: Kuchiguse

    1077. Kuchiguse (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HOU, Qiming The Japan ...

  2. 1077. Kuchiguse (20)【字符串处理】——PAT (Advanced Level) Practise

    题目信息 1077. Kuchiguse (20) 时间限制100 ms 内存限制65536 kB 代码长度限制16000 B The Japanese language is notorious f ...

  3. PAT 甲级 1077 Kuchiguse (20 分)(简单,找最大相同后缀)

    1077 Kuchiguse (20 分)   The Japanese language is notorious for its sentence ending particles. Person ...

  4. 1077. Kuchiguse (20)

    The Japanese language is notorious for its sentence ending particles. Personal preference of such pa ...

  5. PAT Advanced 1077 Kuchiguse (20 分)

    The Japanese language is notorious for its sentence ending particles. Personal preference of such pa ...

  6. PAT甲级——1077.Kuchiguse(20分)

    The Japanese language is notorious for its sentence ending particles. Personal preference of such pa ...

  7. PAT (Advanced Level) 1077. Kuchiguse (20)

    最长公共后缀.暴力. #include<cstdio> #include<cstring> #include<cmath> #include<vector&g ...

  8. PAT甲题题解-1077. Kuchiguse (20)-找相同后缀

    #include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...

  9. PAT A1077 Kuchiguse (20)

    晴神书中AC代码 #include <cstdio> #include <cstring> #include <iostream> using namespace ...

随机推荐

  1. js引入script

    引入再删除,节省资源. <!DOCTYPE html> <html> <head lang="en"> <meta charset=&qu ...

  2. 【BZOJ4597】[Shoi2016]随机序列 线段树

    [BZOJ4597][Shoi2016]随机序列 Description 你的面前有N个数排成一行.分别为A1, A2, … , An.你打算在每相邻的两个 Ai和 Ai+1 间都插入一个加号或者减号 ...

  3. [Algorithms] Heap and Heapsort

    Recently I reviewed the classic heapsort algorithm and implement it according to contents in Introdu ...

  4. REST Representational state transfer REST Resource Naming Guide Never use CRUD function names in URIs

    怎样用通俗的语言解释什么叫 REST,以及什么是 RESTful? - 知乎  https://www.zhihu.com/question/28557115 大家都知道"古代"网 ...

  5. pip与apt-get

    在ubuntu服务器下安装包的时候,经常会用到sudo apt-get install 包名 或 sudo pip install 包名,那么两者有什么区别呢? 1.区别 pip用来安装来自PyPI( ...

  6. Java基础 - 面向对象 - 类的定义

    package mingri.chapter_6; import java.util.Scanner; public class Person { /* * 类变量 * 定义方法: * 数据类型 变量 ...

  7. 第13章—数据库连接池(Druid)

    spring boot 系列学习记录:http://www.cnblogs.com/jinxiaohang/p/8111057.html 码云源码地址:https://gitee.com/jinxia ...

  8. 【查看版本】查看linux版本/查看32还是64

    系统/机器信息 1.查看linux是ubuntu还是centos lsb_release --help -a 打印所有信息 -s 简短打印 2.查看系统是64还是32 uname --help -a ...

  9. Github的markdwon如何使用表情符(Emoji)?表情包大全

    如输入 :smile: 会输出  

  10. FORM pdf预览功能函数 SSFCOMP_PDF_PREVIEW

     函数模块             SSFCOMP_PDF_PREVIEW Smart Forms: PDF Preview (Test) function ssfcomp_pdf_preview. ...