Advertisement
fbinnzhivko

09.00 Index of letters

May 30th, 2016
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2. class IndexOfLetters
  3. {
  4.     static void Main()
  5.     {
  6.         string[] alphabet = new string[]
  7.         {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
  8.  
  9.         string input = Console.ReadLine();
  10.  
  11.         for (int j = 0; j < input.Length; j++)
  12.         {
  13.             for (int i = 0; i < alphabet.Length; i++)
  14.             {
  15.                 if (input[j].ToString().Contains(alphabet[i]))
  16.                 {
  17.                     Console.WriteLine("{0} -> {1}", input[j], i);
  18.                 }
  19.             }
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement