public static void Main2(string[] args) { using (var r = new StreamReader("input.txt")) using (var w = new StreamWriter("output.txt")) { int n = Int32.Parse(r.ReadLine()); _result = new string[n]; var bg = new Task[n]; for (int i = 0; i < n; i++) { var t = new TaskB(r, i); var task = Task.Factory.StartNew(t.Solve); bg[i] = task; } Task.WaitAll(bg); for (int i = 0; i < n; i++) { if (i > 0) { w.WriteLine(); } w.Write("Case #" + (i + 1) + ": [" + String.Join(", ", _result[i].ToCharArray()) + "]"); } } }
public static void Main2(string[] args) { using (var r = new StreamReader("input.txt")) using (var w = new StreamWriter("output.txt")) { int n = Int32.Parse(r.ReadLine()); _result = new string[n]; var bg = new Task[n]; for (int i=0;i<n;i++) { var t = new TaskB(r, i); var task = Task.Factory.StartNew(t.Solve); bg[i] = task; } Task.WaitAll(bg); for (int i=0;i<n;i++) { if (i > 0) w.WriteLine(); w.Write("Case #" + (i+1) + ": [" + String.Join(", ", _result[i].ToCharArray()) + "]"); } } }