diff --git a/examples/dotnet/SpeakerSchedulingSat.cs b/examples/dotnet/SpeakerSchedulingSat.cs index 451a5e0136..5fb99c31c9 100644 --- a/examples/dotnet/SpeakerSchedulingSat.cs +++ b/examples/dotnet/SpeakerSchedulingSat.cs @@ -184,9 +184,9 @@ class SpeakerScheduling public static void Main(String[] args) { int start = 1; - if (args.Length == 1) + if (args.Length >= 2) { - start = int.Parse(args[0]); + start = int.Parse(args[1]); } Stopwatch s = new Stopwatch(); s.Start(); diff --git a/examples/dotnet/cstsp.cs b/examples/dotnet/cstsp.cs index f62f53ae2d..67237fd67d 100644 --- a/examples/dotnet/cstsp.cs +++ b/examples/dotnet/cstsp.cs @@ -103,19 +103,19 @@ class Tsp public static void Main(String[] args) { int size = 10; - if (args.Length > 0) - { - size = Convert.ToInt32(args[0]); - } - int forbidden = 0; if (args.Length > 1) { - forbidden = Convert.ToInt32(args[1]); + size = Convert.ToInt32(args[1]); } - int seed = 0; + int forbidden = 0; if (args.Length > 2) { - seed = Convert.ToInt32(args[2]); + forbidden = Convert.ToInt32(args[2]); + } + int seed = 0; + if (args.Length > 3) + { + seed = Convert.ToInt32(args[3]); } Solve(size, forbidden, seed); diff --git a/examples/dotnet/techtalk_scheduling.cs b/examples/dotnet/techtalk_scheduling.cs index 39e1ca9a5e..aee8b0caae 100644 --- a/examples/dotnet/techtalk_scheduling.cs +++ b/examples/dotnet/techtalk_scheduling.cs @@ -268,9 +268,9 @@ public class SpeakerScheduling public static void Main(String[] args) { int start = 17; - if (args.Length == 1) + if (args.Length >= 2) { - start = int.Parse(args[0]); + start = int.Parse(args[1]); } Stopwatch s = new Stopwatch(); s.Start();