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 |
WA,很简单的,怎么就WA?#include <iostream.h> #include <stdio.h> int main(int argc, char* argv[]) { int b=0,s=11,g; char c[10]; while(1) { b=10; s=1; cin>>g; if(!g) return 0; while(gets(c)) { if(c[4]=='h') if(g-1<b) b=g-1; if(c[4]=='l') if(g+1>s) s=g+1; if(c[4]=='t') { if(g>=s&&g<=b) cout<<"Stan may be honest"<<endl; else cout<<"Stan is dishonest"<<endl; break; } cin>>g; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator