#include<iostream>
using namespace std;
int main()
{
int ji=0,n,h[100005];
cin>>n;
for(int i=1;i<=n;i++)
cin>>h[i];
for(int i=0;i<n;i++)
if(h[i]<h[i+1])
ji+=h[i+1]-h[i];
cout<<ji<<endl;
return 0;
}
标签:NOIP,积木,int,cin,ji,2013 From: https://www.cnblogs.com/chx6/p/16593018.html