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 |
ft, 数据这么恶心.consisting only of characters p through z and N, C, D, E, and I. Each sentence is ended by a new-line characterIn Reply To:奇怪,实在想不出错那了。 Posted by:hujialie at 2003-05-31 22:54:40 > #include "stdio.h" > int sentence; > char sen[300]; > > int main() > { > int i; > while(scanf("%s",sen)==1) > { > sentence=0; > for(i=0;sen[i]!=0;i++); > for(i--;i>=0;i--) > { > if(sen[i]=='C'||sen[i]=='D'||sen[i]=='E'||sen[i]=='I') > { > if(sentence>=2)sentence--; > else > { > sentence=0; > break; > } > } > else > { > if(sen[i]=='N') > { > if(sentence>=1)continue; > else break; > } > else > { > if(sen[i]>='p'&&sen[i]<='z') > { > sentence++; > continue; > } > else > { > sentence=0; > break; > } > } > } > } > if(sentence==1)printf("YES\n"); > else printf("NO\n"); > } > printf("%c",-1); > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator