Advertisement
pifka

Count Symbols

May 19th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Numerics;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Threading.Tasks;
  9.  
  10. namespace solutions
  11. {
  12. class Program
  13. {
  14. public static void Main()
  15. {
  16. var input = Console.ReadLine();
  17.  
  18. var result = new SortedDictionary<char, int>();
  19.  
  20. foreach (var item in input)
  21. {
  22. if (!result.ContainsKey(item))
  23. {
  24. result.Add(item, 0);
  25. }
  26. result[item]++;
  27. }
  28.  
  29. foreach (var item in result)
  30. {
  31. Console.WriteLine($"{item.Key}: {item.Value} time/s");
  32. }
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement