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

这题这样应该ac呀!怎么过不了?

Posted by birdsfly at 2008-06-30 21:45:51 on Problem 2328
#include<iostream>
using namespace std;
int main(){
	int n;
	int x[13] ={0};
	char str[13],str1[13];
	while(1){
		cin>>n;
		if(n == 0)
			break;
		cin>>str>>str1;
		strcat(str,str1);
		if(strcmp(str,"toohigh")==0)
			x[n] = 1;
		else if(strcmp(str,"toolow")==0)
			x[n] = 2;
		else if(strcmp(str,"righton")==0){
			int i,flg = 0;
			for(i = 0;i<11;i++){
				if(x[i]==1&&i<=n)
					flg = 1;
				if(x[i]==2&&i>=n)
					flg = 1;
				x[i] = 0;	
				
			}
			if(flg == 0)
				cout<<"Stan may be honest\n";
			else
				cout<<"Stan is dishonest\n";
		}
	}
	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