第一章-问题求解策略-Uva10340-All in All

分类:简单字符串
题目链接:Uva10340-All in All
水题,按要求做即可

#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
const int maxn=100000+100;
char s[maxn],t[maxn];
int main()
{
    while(scanf("%s %s",s,t)!=EOF)
    {
        int tot=0;
        for(int i=0;i<strlen(t);i++)
        {
            if(t[i]==s[tot])
            {
                tot++;
            }
        }
        if(tot==strlen(s))
        {
            printf("Yes\n");
        }
        else
        {
            printf("No\n");
        }
    }
    return 0;
}
发布了36 篇原创文章 · 获赞 6 · 访问量 4780

猜你喜欢

转载自blog.csdn.net/STL_CC/article/details/105096894
ALL