Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

从RE(INT[10],str[10])到WA(INT[10000],str[10000]),WHY???

Posted by zcxiao at 2006-07-09 10:41:27 on Problem 2328
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator