UVA Problem 10340 (All in All) Solution

Problem Solving, UVa

 

 

#include <bits/stdc++.h>

using namespace std;

char s[100000],t[100000];

int main()

{

    int i,j;

    bool flag;

    while(scanf("%s %s",s,t)!=EOF)

    {

        flag=false;

       

        for(j=0,i=0;t[i]!='\0';i++)

        {

       

        if (s[j] == t[i])

         j++;

        

        if (s[j] == '\0') {

        

        flag = true;

        break;

        }

        }

        if(flag==true)

        printf("Yes\n");

        else    printf("No\n");

    }

return 0;

}

 

0 Comments

You may find interest following article