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

请各位帮忙找找哪里错了~~

Posted by hugett01 at 2009-01-20 01:10:32 on Problem 3672
#include<iostream>
int main(){
	int m,t,u,f,d,p,q,n=0,work=1,flag=0;
	char s;
	scanf("%d%d%d%d%d",&m,&t,&u,&f,&d);
	p=u+d;
	q=2*f;
	for(int i=0;i<t;i++){
		scanf("%c",&s);
		if(work){
			if(s=='f')
				n+=q;
		    else n+=p;
			flag++;
			if(n>m){
				flag--;
				work=0;
			}
		}
	}
	printf("%d\n",flag);
    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