Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:终于AC拉。。。In Reply To:终于AC拉。。。 Posted by:long2006 at 2008-07-28 20:07:48 > 晕啊。。。偶终于AC拉。。。 > #include "stdio.h" > #include "string.h" > > char a[400]; > int flag; > int len; > int i,j; > int main() > { > while((scanf("%s",&a))!=EOF) > { > flag=0; > //scanf("%s",&a); > len=(int)strlen(a); > for(i=len-1;i>=0;i--) > { > if(a[i]>='p'&&a[i]<='z') > { > flag++; > } > else if(a[i]=='C'||a[i]=='D'||a[i]=='E'||a[i]=='I') > { > if(flag>=2) > { > flag--; > } > else > { > flag=0; > break; > } > } > else if(a[i]=='N') > { > if(flag==0) > { > break; > } > } > else > { > flag=0; > break; > } > } > if(flag==1) > { > printf("YES\n"); > } > else > { > printf("NO\n"); > } > for(j=0;j<len;j++) > { > a[j]='\0'; > } > } > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator