function sum(const a: array of integer): integer; var s: integer = 0; v: integer; begin for v in a do s := s + v; sum := v; end;