Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _21.DiffrentLettersInString
- {
- class Program
- {
- static void Main(string[] args)
- {
- var text = "aaaaa bcd eeeff";
- char[] letters = new char[65536];
- for (int i = 0; i < text.Length; i++)
- {
- if (char.IsLetter(text[i]))
- {
- letters[text[i]]++;
- }
- }
- for (int i = 0; i < letters.Length; i++)
- {
- if (letters[i]>0 && char.IsLetter((char)i))
- {
- Console.WriteLine("{0} {1}",(char)i,(int)letters[i]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement