Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program ar;
- const s=8;
- var a:array [1..s] of integer;
- a2, n, j, i, k2, k4, k8, k0, k: integer;
- begin
- read(n);
- k2:=0; k4:=0; k8:=0; k0:=0; k:=0;
- for i:=1 to s do readln(a[i]);
- for i:=s+1 to n do
- begin
- if a[1] mod 8=0 then inc(k8)
- else if a[1] mod 4=0 then inc(k4)
- else if a[1] mod 2=0 then inc(k2)
- else inc(k0);
- readln(a2);
- if a2 mod 8=0 then k:=k+k2+k4+k8+k0
- else if a2 mod 4=0 then k:=k+k2+k4+k8
- else if a2 mod 2=0 then k:=k+k4+k8
- else k:=k+k8;
- for j:=1 to s-1 do a[j]:=a[j+1];
- a[s]:=a2;
- end;
- writeln(k);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement