examples: fix dotnet samples

This commit is contained in:
Corentin Le Molgat
2022-09-05 17:39:18 +02:00
parent 11fb501667
commit f33e95b004
3 changed files with 12 additions and 12 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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();