begin
var a := ArrRandom(10, -10, 10);
a.Println;
a.Transform(t -> Abs(t));
a.Println
end.
var a:array [1..10] of integer;
i:integer;
for i:=1 to 10 do
a[i]:=random(21)-10;
write(a[i]:4)
end;
writeln;
if a[i]<0 then a[i]:=abs(a[i]);
write (a[i]:4)
end
begin
var a := ArrRandom(10, -10, 10);
a.Println;
a.Transform(t -> Abs(t));
a.Println
end.
-1 -6 -8 4 10 -5 -7 -8 10 61 6 8 4 10 5 7 8 10 6var a:array [1..10] of integer;
i:integer;
begin
for i:=1 to 10 do
begin
a[i]:=random(21)-10;
write(a[i]:4)
end;
writeln;
for i:=1 to 10 do
begin
if a[i]<0 then a[i]:=abs(a[i]);
write (a[i]:4)
end
end.