program z1;
var i,n,k,s:integer;
a:array [1..100] of integer;
begin
write ('n (n<=100) = ');
readln (n);
k:=0;
write('Массив: ');
for i:=1 to n do
a[i]:=random(51)-30;
write (a[i],' ');
if (a[i]=0) and (k=0) then k:=i
end;
writeln;
if k=0 then writeln ('Нет элемента равного 0')
else
for i:=k to n do s:=s+a[i];
writeln('s = ',s)
end
end.
program z1;
var i,n,k,s:integer;
a:array [1..100] of integer;
begin
write ('n (n<=100) = ');
readln (n);
k:=0;
write('Массив: ');
for i:=1 to n do
begin
a[i]:=random(51)-30;
write (a[i],' ');
if (a[i]=0) and (k=0) then k:=i
end;
writeln;
if k=0 then writeln ('Нет элемента равного 0')
else
begin
for i:=k to n do s:=s+a[i];
writeln('s = ',s)
end
end.