SHARE
TWEET

Untitled

a guest Nov 19th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program task2;
  2. var
  3. A:array[1..10] of integer;
  4. i,sum:integer;
  5. begin
  6.   sum:=0;
  7. for i:=1 to 10 do
  8.   begin
  9.   A[i]:=Random(20); //заполняем случайными числами
  10.   //writeln('t ',A[i]); вывод чисто для теста
  11.   end;
  12. for i:=1 to 10 do //второй проход по массиву
  13.   begin
  14.   if A[i]<10 then //если меньше 10
  15.     sum:=sum+A[i];
  16.   if (A[i] mod 3 = 0) and (A[i] mod 5 <> 0) then //если кратно 3 и не кратно 5
  17.     writeln(i);
  18.   end;
  19. writeln('Сумма чисел меньше 10: ',sum);  
  20. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top