diff options
Diffstat (limited to 'mono/tests/fib.cs')
-rwxr-xr-x | mono/tests/fib.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mono/tests/fib.cs b/mono/tests/fib.cs index 3a3dff99744..212889482a0 100755 --- a/mono/tests/fib.cs +++ b/mono/tests/fib.cs @@ -1,3 +1,5 @@ +using System; + public class Fib { public static int fib (int n) { @@ -5,9 +7,18 @@ public class Fib { return 1; return fib(n-2)+fib(n-1); } - public static int Main () { - if (fib (32) != 3524578) - return 1; + public static int Main (string[] args) { + int repeat = 1; + + if (args.Length == 1) + repeat = Convert.ToInt32 (args [0]); + + Console.WriteLine ("Repeat = " + repeat); + + for (int i = 0; i < repeat; i++) + if (fib (32) != 3524578) + return 1; + return 0; } } |