An array A (m) is given. Replace the negative elements of array A up to the maximum element with zeros.

(Solution provided in Python 3.6.4 programming language)
To begin with, let’s create an empty array, which will then be sequentially filled with elements entered by the user from the keyboard, in the amount of m.

Then, using the for loop, we iterate over all the elements of the array and, thanks to the if condition, determine the element with the maximum value. Then, using the while loop, we replace the negative elements of the array located up to the maximum element by 0. As a result, we get the following program:

m = int (input ())
a = []
max = 0
for i in range (m):
b = int (input ())
a.append (b)
for i in range (m):
if a [i]> max:
max = a [i]
i = 0
while a [i]! = max:
if a [i] <0:
a [i] = 0
i + = 1
print (a)



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.