pascalabcnet/InstallerSamples/!MainFeatures/03_Subroutines/FuncParams.pas

12 lines
240 B
ObjectPascal
Raw Permalink Normal View History

// Переменное число параметров
2015-05-14 22:35:07 +03:00
function Sum(params arg: array of integer): integer;
begin
Result := 0;
foreach var x in arg do
Result += x;
end;
begin
writeln(Sum(1,2,3));
writeln(Sum(4,5,6,7));
end.