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;
- namespace ConsoleApplication37
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] Letters=new int[26];
- Console.WriteLine("Type a string");
- string St = Console.ReadLine().ToLower();
- int Asterick = St.IndexOf('*');
- for (int i = 0; i < Asterick; ++i)
- {
- int Num = ((int)St[i])-97;
- Letters[Num] =Letters[Num]+1;
- }
- for (int i = 0; i < Letters.Length; ++i)
- {
- if (Letters[i] > 0)
- {
- Console.WriteLine("Letter {0}:{1}", (char)(i + 97), Letters[i]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment