码迷,mamicode.com
首页 > 其他好文 > 详细

POJ1936

时间:2019-09-19 22:05:08      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:res   class   char   color   lse   分类   for   oem   str   

Sample Input

sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter

Sample Output

Yes
No
Yes
No

POJ题目分类 串。
水题, 但Yes错写成YES, No错写成NO WA了好几次
const int maxn = 1e5 + 24;
char a[maxn], b[maxn];

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    while(~scanf("%s%s", a, b)) {
        int x = strlen(a), y = strlen(b);
        int i, j;
        for(i = 0, j = 0; i < x && j < y; j++) i += (a[i] == b[j]);
        if(i == x) puts("Yes");
        else puts("No");
    }

    return 0;
}

 

 

POJ1936

标签:res   class   char   color   lse   分类   for   oem   str   

原文地址:https://www.cnblogs.com/000what/p/11552529.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!