pascalabcnet/TestSamples/CompilationSamples/FuncParams.pas
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

12 lines
220 B
ObjectPascal

// Ïåðåìåííîå ÷èñëî ïàðàìåòðîâ
function Sum(params arg: array of integer): integer;
begin
Result := 0;
foreach x: integer in arg do
Result += x;
end;
begin
writeln(Sum(1,2,3));
writeln(Sum(4,5,6,7));
end.