• На промежутке [-10,10] опоеделить количетаво кратных 5, сумму отрицателтных четных, произведение полодительных. Заранее спасибо!

Ответы 2

  • varn,i,p, sum: integer;a: array [1..10] of integer;beginp:=1;sum:=0;for i:=1 to 10 dobeginread (a[i]); if a[i]>0 then  p:=p* a[i] ; if a[i]<0 then sum:=sum+a[i];  if a[i] mod 5=0 then n:=n+1;end; writeln ('kratno 5=',n);writeln ('summa=',sum); writeln ('proizvedeniel=',p);end.
  • //Dev-C++ 5.11 (C)#include <stdio.h>int main(void) {int k=0,s=0,p=1; for(int i=-10;i<11;i++)  {if(i%5==0)   k++;  if(i<0)   s=s+i;  if(i>0)   p=p*i;} printf("%d %d %d",k,s,p); return 0;}
    • Автор:

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

Еще вопросы

Войти через Google

или

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

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

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