Beispiel #1
0
        static void Main()
        {
            var records = new List <long>();

            while (true)
            {
                try
                {
                    using (var sc = new SetConsole())
                    {
                        var sw = new Stopwatch();
                        sw.Start();
                        Program.Main(null);
                        sw.Stop();
                        records.Add(sw.ElapsedMilliseconds);
                        sw.Reset();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                    Console.WriteLine("\n====================");
                    Console.WriteLine("Process was supended");
                    Console.WriteLine("====================\n");
                }
                if (records.Any())
                {
                    Console.WriteLine("\n====================");
                    Console.WriteLine($"Time is {records.Last()}ms");
                    Console.WriteLine($"AveTime is {records.Average()}ms");
                    Console.WriteLine("====================\n");
                }
            }
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            using (var sc = new SetConsole())
            {
                var c = new int[3][];
                for (int i = 0; i < 3; i++)
                {
                    c[i] = new int[3];
                }
                for (int i = 0; i < 3; i++)
                {
                    c[i] = GetArray <int>();
                }

                int[] x = new int[3], y = new int[3];
                y    = c[0];
                x[0] = 0;
                x[1] = c[1][0] - y[0];
                x[2] = c[2][0] - y[0];
                for (int i = 0; i < c.Length; i++)
                {
                    for (int j = 0; j < c[0].Length; j++)
                    {
                        if (c[i][j] != x[i] + y[j])
                        {
                            CWrite("No");
                            return;
                        }
                    }
                }
                CWrite("Yes");
            }
        }