标签:turn std name include pac return cout pre clu
#include<bits/stdc++.h>
using namespace std;
long long int i,j,k,n,a[100001],cnt=0;
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
for(i=2;i<=n;i++)
{
cnt+=max(a[i],a[i-1]);
}
cout<<cnt;
return 0;
}
标签:turn std name include pac return cout pre clu
原文地址:https://www.cnblogs.com/dwj030917/p/10427155.html