Advertisement
Guest User

Untitled

a guest
May 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. program ar;
  2. const s=8;
  3. var a:array [1..s] of integer;
  4. a2, n, j, i, k2, k4, k8, k0, k: integer;
  5. begin
  6. read(n);
  7. k2:=0; k4:=0; k8:=0; k0:=0; k:=0;
  8. for i:=1 to s do readln(a[i]);
  9. for i:=s+1 to n do
  10. begin
  11. if a[1] mod 8=0 then inc(k8)
  12. else if a[1] mod 4=0 then inc(k4)
  13. else if a[1] mod 2=0 then inc(k2)
  14. else inc(k0);
  15. readln(a2);
  16. if a2 mod 8=0 then k:=k+k2+k4+k8+k0
  17. else if a2 mod 4=0 then k:=k+k2+k4+k8
  18. else if a2 mod 2=0 then k:=k+k4+k8
  19. else k:=k+k8;
  20. for j:=1 to s-1 do a[j]:=a[j+1];
  21. a[s]:=a2;
  22. end;
  23. writeln(k);
  24. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement