program z6; uses crt; var a:array[1..260] of shortint; i,n,k,l:byte; s:longint; begin clrscr; randomize; write('Vvedi razmernost massiva='); readln(n); for i:=1 to n do begin a[i]:=random(100--100+1)+-100; write(a[i]:4); end; write('Vvedi k='); readln(k); write('Vvedi l='); readln(l); for i:=k to l do s:=s+a[i]; write('Summa chisel s k po l ravna ',s); readkey end.
program z6;
uses crt;
var
a:array[1..260] of shortint;
i,n,k,l:byte;
s:longint;
begin
clrscr;
randomize;
write('Vvedi razmernost massiva='); readln(n);
for i:=1 to n do begin
a[i]:=random(100--100+1)+-100;
write(a[i]:4);
end;
write('Vvedi k='); readln(k);
write('Vvedi l='); readln(l);
for i:=k to l do
s:=s+a[i];
write('Summa chisel s k po l ravna ',s);
readkey
end.