program z4; uses crt; var a:array[1..25] of shortint; i:byte; s:longint; begin clrscr; randomize; for i:=1 to 25 do begin a[i]:=random(10--10+1)+-10; write(a[i]:4); if a[i]<0 then s:=s+a[i]*a[i]*a[i]; end; writeln; write('‘Сумма кубов отрицательных чисел равна ',s); readkey end.
program z4;
uses crt;
var a:array[1..25] of shortint;
i:byte;
s:longint;
begin
clrscr;
randomize;
for i:=1 to 25 do begin
a[i]:=random(10--10+1)+-10;
write(a[i]:4);
if a[i]<0 then
s:=s+a[i]*a[i]*a[i];
end;
writeln;
write('‘Сумма кубов отрицательных чисел равна ',s);
readkey
end.