mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-22 08:33:48 +01:00
16 lines
216 B
ObjectPascal
16 lines
216 B
ObjectPascal
unit GrashopperSummation;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
function Summation(const N: Integer): Integer;
|
|
|
|
implementation
|
|
|
|
function Summation(const N: Integer): Integer;
|
|
begin
|
|
Result := N*(N + 1) div 2;
|
|
end;
|
|
|
|
end.
|