标签:while amp main ret tor using nbsp name cout
#include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n&&n!=0){
int t;
int t0=0;
int sum=0;
while(n--){
cin>>t;
if(t>t0)
sum += (t-t0)*6;
else
sum += (t0-t)*4;
t0=t;
sum +=5;
}
cout<<sum<<endl;
}
return 0;
}
标签:while amp main ret tor using nbsp name cout
原文地址:http://www.cnblogs.com/sysu-eeman-yang/p/5987443.html