UVa 10340:All in All

Problem Link


<Source Code>

#include<stdio.h>
#include<string.h>
int main()
{
char a1[100000],a2[100000];
while(scanf(“%s %s”,a1,a2)!=EOF){
if(strlen(a1)>strlen(a2))
printf(“No\n”);
else{
long long int index=0,i;
for(i=0;i<strlen(a2);i++)
{if(a1[index]==a2[i])
index++;
}

if(index==strlen(a1))
printf(“Yes\n”);
else
printf(“No\n”);
}
}
return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s