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 |
奇怪,实在想不出错那了。#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