Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace Advanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- var text = Console.ReadLine().ToCharArray();
- var symbols = new SortedDictionary<char, int>();
- for (int i = 0; i < text.Length; i++)
- {
- if (!symbols.ContainsKey(text[i]))
- {
- symbols[text[i]] = 0;
- }
- symbols[text[i]]++;
- }
- foreach (var symbol in symbols)
- {
- Console.WriteLine($"{symbol.Key}: {symbol.Value} time/s");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment