fork(1) download
  1. program ideone;
  2. var a, n, i, mx: integer; {от -32767 до 32768}
  3. begin
  4. mx := 0;
  5. read(n);
  6.  
  7. for i:= 1 to n do
  8. begin
  9. readln(a);
  10. if a mod 6 = 0 then
  11. mx := mx + a;
  12. end;
  13.  
  14. writeln(mx);
  15. end.
Success #stdin #stdout 0.01s 5308KB
stdin
3
12
25
6

stdout
18