Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a:array[1..20] of integer;
- i,j,k,n,a1,pk3,a2,ok3:integer;
- begin
- readln(n);
- readln(a1);
- ok3:=0;pk3:=0;post:=0;oost:=0;
- For i:=2 to n do begin
- If (a1>0) and (a1 mod 3=0) then inc(pk3)
- Else if (a1<0) and (a1 mod 3=0) then inc(ok3);
- readln(a2);
- If (a2>0) and (a2 mod 3=0) then k:=k+pk3+ok3
- Else if (a2<0) and (a2 mod 7=0) then k:=k+ok3+ok3
- a1:=a2;
- end;
- writeln(k);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement