#include<stdio.h>
#define N 100

bool judge(char *p){
	while(p){
		if(*p=='a'){//嵌套匹配
		p++;
		if(*p=='b'){
		p++;
		if(*p=='c'){
		p++;
		while(*p!='d'){
		p++;//跳过任意个中间字符
		}
        if(p==NULL)return false;//如果到结尾还没有找到d
		else{
			if(*p=='d'){
			p++;
			if(p!=NULL){//?任意字符不为空,继续往下找
			  p++;
			  if(*p=='e')
				  return true;
			}
			}
		}
		}
		}
		}
			return false;
	}
	return false;
}
int main(){
	char s[N];
	FILE *fp;
	fp=fopen("3.in","r");
	bool flag=false;
	fgets(s,99,fp);
	int i=0;
	while(s[i]!='\0'){
		flag=judge(s+i);
		if(flag){printf("找到该序列");break;}
		else{
		   i++;
		}
	}
	if(flag==false)printf("未找到序列");
return 0;
}