var a:array[1..100] of integer;
i,s:integer;
Begin
randomize; n:=20; for i:= 1 to n do begin a[i]:=random(n*10)- 10*n div 2 ; write(a[i]:4); if i mod 10=0 then writeln;
if a[i]>=0 then s:= s+a[i]; end;
for i:= 1 to n do begin
if a[i]<0 then a[i]:=s;
write(a[i]:4); if i mod 10=0 then writeln;
end;
End.
var a:array[1..100] of integer;
i,s:integer;
Begin
randomize;
n:=20;
for i:= 1 to n do begin
a[i]:=random(n*10)- 10*n div 2 ;
write(a[i]:4);
if i mod 10=0 then writeln;
if a[i]>=0 then s:= s+a[i];
end;
for i:= 1 to n do begin
if a[i]<0 then a[i]:=s;
write(a[i]:4);
if i mod 10=0 then writeln;
end;
End.