const
n=10;
var
arr; array[1.. 100] of integer;
i: integer;
begin
for i:=1 to n do
read(arr[i]);
if arr [i]<0 then
arr[i]:=0
end;
for i:=1 to n do write (arr[i], ' ') ;
end.
2
const N = 15;
arr: array[1..N] of integer;
i, k: byte;
randomize;
for i:=1 to N do begin
arr[i] := random(100) - 50;
write(arr[i]:4);
writeln;
write('Введите k <= ', N, ': ');
readln(k);
if k > N then exit;
for i:=1 to k do arr[i] := -1 * arr[i];
for i:=1 to N do
const
n=10;
var
arr; array[1.. 100] of integer;
i: integer;
begin
for i:=1 to n do
begin
read(arr[i]);
if arr [i]<0 then
arr[i]:=0
end;
for i:=1 to n do write (arr[i], ' ') ;
end.
2
const N = 15;
var
arr: array[1..N] of integer;
i, k: byte;
begin
randomize;
for i:=1 to N do begin
arr[i] := random(100) - 50;
write(arr[i]:4);
end;
writeln;
write('Введите k <= ', N, ': ');
readln(k);
if k > N then exit;
for i:=1 to k do arr[i] := -1 * arr[i];
for i:=1 to N do
write(arr[i]:4);
writeln;
end.