您的位置:首页 > 其它

hdoj   acm    1008

2015-12-18 18:05 387 查看
#include<iostream>

using
namespace std;

int
main()

{


int N;


while(cin>>N)


{


int time=0,from=0,to=0;





if(N==0) break;


for(int i=0;i<N;i++)


{


cin>>to;


if(to>from)


time+=(to-from)*6+5;


else


time+=(from-to)*4+5;


from=to;






}


cout<<time<<endl;


}

}

这个代码很是纠结,,,,,,
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: