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,疯了#include<iostream> #include<string> using namespace std; int main() { int g[1000]; int i=0,j=0,Max=11,Min=0; while (1) { string a,b[1000]; while (a.size()!=5) { cin>>g[i]; if(g[i]==0)break; cin>>a>>b[i]; i++; } if(g[i]==0)break; i=i-1; if(g[i]<=Min||g[i]>=Max){cout<<"Stan is dishonest"<<endl;break;} for(j=0;j<i;j++) { if(b[j].size()==4&&g[i]>=g[j]){cout<<"Stan is dishonest"<<endl;break;} if(b[j].size()==3&&g[i]<=g[j]){cout<<"Stan is dishonest"<<endl;break;} } if(j==i)cout<<"Stan may be honest"<<endl; i=0;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