WR
#include <iostream>
using namespace std;
#define N 100
int eleUp(int sumTime,int k)
{
return sumTime+6*k;
}
int eleDown(int sumTime,int k)
{
return sumTime+4*k;
}
int main()
{ int i=0;
int sum=0;
int n=0;
int copyN=0;
int a[N]={0};
while(cin>>n&&n>0)
{
a[i]=n;
i++;
if(copyN>a[i-1])
{
sum=eleDown(sum,copyN-a[i-1]);
}
if(copyN<a[i-1])
{
sum=eleUp(sum,a[i-1]-copyN);
}
copyN=a[i-1];
}
cout<<sum+5<<endl;
}
我觉得题目有些问题