Exemple #1
0
 static void ShowStatistics(WordCounter wc)
 {
     int uniqueWords = 0;
     int allWords = 0;
     foreach (var obj in wc.GetDict())
     {
         allWords += obj.Value;
         if (obj.Value == 1) ++uniqueWords;
         Console.WriteLine("{0} {1}", obj.Key, obj.Value);
     }
     Console.WriteLine("всего слов {0} уникальных {1}", allWords, uniqueWords);
 }
Exemple #2
0
        static void ShowStatistics(WordCounter wc)
        {
            int uniqueWords = 0;
            int allWords    = 0;

            foreach (var obj in wc.GetDict())
            {
                allWords += obj.Value;
                if (obj.Value == 1)
                {
                    ++uniqueWords;
                }
                Console.WriteLine("{0} {1}", obj.Key, obj.Value);
            }
            Console.WriteLine("всего слов {0} уникальных {1}", allWords, uniqueWords);
        }