summaryrefslogtreecommitdiff
path: root/gcd.pas
diff options
context:
space:
mode:
Diffstat (limited to 'gcd.pas')
-rw-r--r--gcd.pas6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcd.pas b/gcd.pas
index 4253807..2461ee8 100644
--- a/gcd.pas
+++ b/gcd.pas
@@ -1,6 +1,6 @@
{
FreePascal: https://www.freepascal.org/
-Tested with FreePascal 2.4.0, 3.0.0
+Tested with FreePascal 3.2
Usage:
@@ -39,8 +39,12 @@ Var
n: array Of integer;
i: integer;
Begin
+ If ParamCount = 0 then exit;
+
SetLength(n, ParamCount);
+
For i := 1 To ParamCount Do
n[i-1] := StrToInt(ParamStr(i));
+
Writeln(gcdn(n))
End.