#include <stdio.h>
typedef struct
{
    char a[21];       /* 存放字符串,最好不要超过20个*/
    int i;     /* 当前字符的位置 */
    int n;   /* 字符串的长度 */
}str;
str st;
main()
{
   int k;
   printf("please input a string : \n");
   scanf("%s",st.a);
   st.i=st.n=0;
   while(st.a[st.n]!='\0')
       st.n++;
   st.n--;
   judge();
   if(st.i<st.n)
     printf("NO\n");
   else printf("YES\n");
}
int judge()
{
   if(st.i>st.n)     /* 如果大于字符串的长度,还没退出函数,则必是错误的句子 */
   {
      printf("NO\n"); exit(0);
    }
   if(st.a[st.i]>='p' && st.a[st.i]<='z')
   {
      st.i++;
      return;
   }
   if(st.a[st.i]=='N')
   {
      while(st.a[st.i]=='N')
         st.i++;
      return;
   }
   switch(st.a[st.i])
   {
     case 'C': st.i++; judge(); judge(); break;
     case 'D': st.i++; judge(); judge(); break;
     case 'E': st.i++; judge(); judge(); break;
     case 'I': st.i++; judge(); judge(); break;
     default : printf("NO\n"); exit(0);
    }
}

片言可以明百意 坐驰可以役万里



											

	    

	
										
					
	