Есть ответ 👍

Составить программу которая формирует массив из 9 случайных целых чисел на промежутке от -30,30 и вычислите: а) сумму отрицательных чисел б) произведение чётных чисел

164
193
Посмотреть ответы 2

Ответы на вопрос:


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) + '.')

Популярно: Информатика