delete pics to save space
This commit is contained in:
15
1.5019.cpp
Normal file
15
1.5019.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include<cstdio>
|
||||
int n,res,last,x;
|
||||
int main()
|
||||
{
|
||||
scanf("%d%d",&n,&last);
|
||||
res=last;
|
||||
for(int i=2;i<=n;i++)
|
||||
{
|
||||
scanf("%d",&x);
|
||||
if(x>last) res+=x-last;
|
||||
last=x;
|
||||
}
|
||||
printf("%d\n",res);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user