1.
Program suma;
Var a, b, sum, i:integer;
begin
read(a);
read(b);
for i:=a to b do sum:=sum+i;
write(sum);
end.
2.
Program multip;
Var a, b, m, i:integer;
begin
m:=1;
read(a);
read(b);
for i:=a to b do m:=m*i;
write(m);
end.
3.
Program suma2;
Var a:array [1..5] of integer;
i, sum:integer;
begin
for i:=1 to 5 do read(a[i]);
for i:=1 to 5 do
sum:=sum + a[i] * a[i];
write(sum);
end.
4.
Program cnt_nopos;
Var a:array [1..5] of integer;
i, cnt:integer;
begin
for i:=1 to 5 do read(a[i]);
for i:=1 to 5 do
if a[i] < 0 then Inc(cnt);
write(cnt);
end.
5.
Var a:array [1..5] of integer;
i, max:integer;
begin
for i:=1 to 5 do read(a[i]);
max:=a[1];
for i:=1 to 5 do
if a[i] > max then
max:=a[i];
write(max);
end.