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(INT[10],str[10])到WA(INT[10000],str[10000]),WHY???#include <iostream> #include <string> using namespace std; int main() { int INT[10000]; string str[10000]; int i=0,j,p=1; cin>>INT[i]; string s; while(INT[i]!=0) { cin>>s>>str[i]; if(str[i] == "on") { for(j=0;j<i;j++) { if(INT[j]<INT[i]&&str[j]!="low") {p=0; cout<<"Stan is dishonest"<<endl;break;} else if(INT[j]>INT[i]&&str[j]!="high") {p=0; cout<<"Stan is dishonest"<<endl;break;} } i=-1; if(p)cout<<"Stan may be honest"<<endl; p=1; } i++; cin>>INT[i]; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator