第一章-問題求解策略-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;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章