Advertisement
horrorking

prog4ege

Apr 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.38 KB | None | 0 0
  1. var
  2. a:array[1..20] of integer;
  3. i,j,k,n,a1,pk3,a2,ok3:integer;
  4. begin
  5. readln(n);
  6. readln(a1);
  7. ok3:=0;pk3:=0;post:=0;oost:=0;
  8. For i:=2 to n do begin
  9. If (a1>0) and (a1 mod 3=0) then inc(pk3)
  10. Else if (a1<0) and (a1 mod 3=0) then inc(ok3);
  11.  
  12. readln(a2);
  13. If (a2>0) and (a2 mod 3=0) then k:=k+pk3+ok3
  14. Else if (a2<0) and (a2 mod 7=0) then k:=k+ok3+ok3
  15.  
  16. a1:=a2;
  17. end;
  18. writeln(k);
  19.  
  20. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement