Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Order_By_Age
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] word = Console.ReadLine().Split();
- Dictionary<char, int> output = new Dictionary<char, int>();
- for (int i = 0; i < word.Length; i++)
- {
- string some = word[i];
- foreach (char item in some)
- {
- if (output.ContainsKey(item))
- {
- output[item]++;
- }
- else
- {
- output[item] = 1;
- }
- }
- }
- foreach (var num in output)
- Console.WriteLine($"{num.Key} -> {num.Value}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement