UVa10340

//UVa10340 - All in All
//题目:判断s串是不是t串的子串。
//已AC
#include<stdio.h>
#include<string.h>
int main(){
	//freopen("data.in","r",stdin);
	char ch, s[100];
	while(scanf("%s",s) != EOF){
		scanf(" "); 
		int count=0; 
		//1.边读取边比较,往前推进
		while((ch=getchar())!='
' && ch!=EOF) if(s[count]==ch) count++;
		//2.得到的正确字符个数
		if(count==(int)strlen(s)) printf("Yes
");
		else printf("No
");
		memset(s,0,sizeof(s));
	}
	return 0;
}

//输入样例:DI1=ge DI2=gweijie DO=YES   
//输入样例:DI1=ge DI2=weijie DO=NO

原文地址:https://www.cnblogs.com/gwj1314/p/9444952.html