Exemple #1
0
        public static void Main()
        {
            WriteLine("Problem 79");

            string answer = Problem79.Solve();

            WriteLine($"answer = {answer}");        // 73162890

            WriteLine("Done");
            ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Problem79 prog = new Problem79();
            FileInfo file = new FileInfo("keylog.txt");
            StreamReader sr = new StreamReader(file.FullName);
            List<string> lines = new List<string>();
            while( sr.Peek() >= 0 )
            {
                string input = sr.ReadLine();
                // we dont need duplicates
                if (!lines.Contains(input))
                {
                    lines.Add(input);
                }
            }
            //lines.Sort();
            List<string> failed = new List<string>();
            foreach (string line in lines)
            {
                if (!prog.AddInput(line))
                {
                    failed.Add(line);
                }

            }
            foreach (string line in failed)
            {
                if (prog.check(line))
                {
                    Console.WriteLine(line);
                }

            }

            Console.ReadKey();
        }