水的不能行,这题我都能出个把来娱乐大众
#include<cstdio>
int main(){
int station,floor,time,n,i;
while(scanf("%d",&n)){
if(n==0) break;
time=0;
floor=0;
for(i=1;i<=n;i++){
scanf("%d",&station);
if(station>floor) time+=(station-floor)*6+5;
if(station<floor) time+=(floor-station)*4+5;
if(station==floor) time+=5;
floor=station;
}
printf("%d\n",time);
}
return 0;
}