В массиве В 20 элементов. Найти и напечатать. Увеличить положительные элементы на 2, отрицательные элементы уменьшить на 1, а нулевые оставить без изменения — Pascal(Паскаль)

program Dekio;
const
n=20;
var
mas :array[1..n] of integer;
i :integer;
begin
randomize;
for i:=1 to n do
begin
mas[i]:=random(10)-3;
write(mas[i]:3);
if mas[i]<0 then
mas[i]:=mas[i]-1;
if mas[i]>0 then
mas[i]:=mas[i]+2;
end;
writeln;
for i:=1 to n do
write(mas[i]:3);
end.

Leave a Comment

+ 51 = 60