//Pascal //random [-10;10] var A: array[1..10] of real; i: byte; begin randomize; for i := 1 to 10 do begin A[i] := random(21)-10; write(A[i]:5); end; writeln; for i := 1 to 10 do begin if A[i] > 0 then A[i] := A[i] / 2; if A[i] < 0 then A[i] := i; write(A[i]:5); end; end.
//random [-10;10]
var
A: array[1..10] of real;
i: byte;
begin
randomize;
for i := 1 to 10 do
begin
A[i] := random(21)-10;
write(A[i]:5);
end;
writeln;
for i := 1 to 10 do
begin
if A[i] > 0 then A[i] := A[i] / 2;
if A[i] < 0 then A[i] := i;
write(A[i]:5);
end;
end.