# Given an array B (20), replace all negative numbers in it by 1, and positive numbers by 2.

January 20, 2021 | education

| Program mass;

var

A: array [1..100] of integer;

i: integer;

begin

randomize;

for i: = 1 to 20 do A [i]: = 1000-random (2000) +1; {This will give both positive and negative numbers in the range from -1000 to 1000}

for i: = 1 to 20 do

begin

if A [i] <0 then A [i]: = 1;

if A [i]> 0 then A [i]: = 2;

end;

for i: = 1 to 20 do write (a [i], ”);

readln

end.

One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.