Advertisement
horrorking

GoDDamN

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