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

学会了一个%*c

Posted by TSERROF at 2012-08-31 16:23:45 on Problem 3672
#include <cstdio>
int main()
{
	int M,T,Up,Flat,Down;
	while(scanf("%d%d%d%d%d",&M,&T,&Up,&Flat,&Down)!=EOF)
	{
		int time=0,ans=0;
		char ch;
		ch=getchar();
		for(int i=0;i!=T;++i)
		{
			scanf("%c%*c",&ch);
			if(ch=='u' || ch=='d')time+=(Up+Down);
			else if(ch=='f')time+=2*Flat;
			if(time<=M)++ans;
		}
		printf("%d\n",ans);
	}
	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