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;
- namespace ConsoleTests
- {
- class ConsoleTests
- {
- static void Main()
- {
- string text = Console.ReadLine();
- char[] characters = text.ToLower().ToCharArray();
- Array.Sort(characters, StringComparer.InvariantCulture);
- int count = 1;
- for (int i = 0; i < characters.Length && i+1 < characters.Length; i++)
- {
- if (Char.IsLetter(characters[i]))
- {
- if (characters[i] == characters[i + 1])
- {
- count++;
- }
- else
- {
- Console.WriteLine("{0} --> {1}", characters[i], count);
- count = 1;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment