コード例 #1
0
        private static void Main()
        {
            IInputReader inputReader = Program.GetInputReader();

            string L = inputReader.ReadLine();
            int    N = int.Parse(inputReader.ReadLine());

            MorseDecoder decoder = new MorseDecoder();

            for (int i = 0; i < N; i++)
            {
                string W = inputReader.ReadLine();

                if (!decoder.WordsByFirstLetter.ContainsKey(W[0]))
                {
                    decoder.WordsByFirstLetter[W[0]] = new HashSet <string>();
                }

                decoder.WordsByFirstLetter[W[0]].Add(W);
                decoder.FirstLetters.Add(W[0]);
            }

            inputReader.Dispose();

            Console.WriteLine(decoder.DecodeAndReturnMessagesCountAsync(L).GetAwaiter().GetResult());
            Console.Read();
        }
コード例 #2
0
 public void Dispose()
 {
     UnsubscribeInputEvents();
     inputReader.Dispose();
     OnLineCreated = null;
 }