Pagini recente » Cod sursa (job #1833900) | Cod sursa (job #1478530) | Cod sursa (job #2602159) | Cod sursa (job #1641204) | Cod sursa (job #599908)
Cod sursa(job #599908)
const fin = 'operatii.in'; fout = 'operatii.out';
procedure main();
var
n ,i ,a ,b ,sol : longword;
begin
assign( input, fin ); reset( input );
assign( output, fout ); rewrite( output );
a := 0; b := 0; sol := 0;
readln( n );
for i := 1 to n do
begin
a := b;
read( b );
if (b > a) then sol := sol + (b - a);
end;
write( sol , #10 );
end;
begin
main();
end.