| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
那位GG/JJ帮忙改正一下——hdu1008#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator