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 00liuqing at 2008-10-20 17:08:50 on Problem 3672
#include<iostream>
using namespace std;
int main()
{
	int m,t,u,f,d,res=0;
	char p;
	cin>>m>>t>>u>>f>>d;
	while(t--)
	{
		cin>>p;
		if(m<=0)
			continue;
		if(p=='u' || p==d)
			m=m-u-d;
		else m=m-f-f;
		if(m>=0)
			res++;
	}
	cout<<res<<endl;
	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