Exemple #1
0
        public static void MainTest(string[] args)
        {
            TextInput StdIn    = new TextInput();
            Alphabet  alphabet = new Alphabet(args[0]);
            int       R        = alphabet.Radix;

            int[] count = new int[R];
            while (StdIn.HasNextChar())
            {
                char c = StdIn.ReadChar();
                if (alphabet.Contains(c))
                {
                    count[alphabet.ToIndex(c)]++;
                }
            }
            for (int c = 0; c < R; c++)
            {
                Console.WriteLine(alphabet.ToChar(c) + " " + count[c]);
            }
        }