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

那位GG/JJ帮忙改正一下——hdu1008

Posted by lanyunfei at 2009-03-24 10:36:11
#include<stdio.h>
int main()
{
	int to,floor=0,up,down,time=0;
	while(scanf("%d",&to)!=EOF)
	{
		if(to-floor>0)//*上楼
		{
			up=to-floor;
			time+=6*up;//*上楼所花时间
		}
		else               //*下楼
		{
			down=floor-to;
			time+=4*down;//*下楼所花时间
		}
		time+=5;//*停留时间
	}
	printf("%d",time);
	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