• Задача в паскале среди 10 введенных с клавиатуры чисел подсчитать количество отрицательных и произведение положительных чисел рассмотреть случай когда положительных чисел нет

Ответы 1

  • program test;

    var n, total, counter, i:integer;begin   total:=1;   counter:=0;   for i:=1 to 10 do   begin      read(n);      if n < 0 then         counter:=counter+1      else if n > 0 then         total:=total*n;   end;   writeln('The number of negative elements = ', counter);   if total = 1 then      writeln('Positive numbers no')   else      writeln('The product of positive numbers = ', total);   readln;end.

    • Автор:

      rubiozm95
    • 6 лет назад
    • 0
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years