예제 #1
0
        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()) + "]");
                    }
                }
        }
예제 #2
0
파일: TaskB.cs 프로젝트: alevshunov/Magicka
        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()) + "]");
                }
            }
        }