Составить программу которая формирует массив из 9 случайных целых чисел на промежутке от -30,30 и вычислите: а) сумму отрицательных чисел б) произведение чётных чисел
164
193
Ответы на вопрос:
Var mas: array [1..9] of integer; summ, count: integer; i: integer; begin randomize; summ : = 0; count : = 1; for i : = 1 to 9 do begin mas[i] : = random(-30, 30); write(mas[i] : 4); if mas[i] < 0 then summ : = summ + mas[i]; if mas[i] > 0 then count : = count * mas[i]; end; writeln(''); writeln('сумма отрицательных элементов: ', summ); writeln('произведение положительных элементов: ', count); end.
A= int(('the next number for the number', str(a), 'is', str(a+1) + '.') print('the previous number for the number', str(a), 'is', str(a-1) + '.')
Популярно: Информатика
-
kukolkabarb25.10.2021 05:31
-
Dapx17.09.2021 06:35
-
Фруктовыйостров12.10.2020 01:20
-
Иванджелина12.08.2022 16:59
-
pravikvdushe15.07.2021 19:21
-
vvkim8702.10.2020 02:08
-
PRIL8212.03.2020 13:11
-
Karbobo21.12.2022 21:17
-
Deelay08.07.2021 04:49
-
Волна161023.05.2021 02:25