Advertisement
fbinnzhivko

Untitled

May 30th, 2016
743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. class IndexOfLetters
  4. {
  5.     static void Main()
  6.     {
  7.         char[] alphabet = Enumerable.Range('a', 'z' - 'a' + 1).Select(i => (Char)i).ToArray();
  8.         string input = Console.ReadLine();
  9.        
  10.         for (int j = 0; j < input.Length; j++)
  11.         {
  12.             for (int i = 0; i < alphabet.Length; i++)
  13.             {
  14.                 if (input[j].ToString().Contains(alphabet[i]))
  15.                 {
  16.                     Console.WriteLine("{0} -> {1}", input[j], i);
  17.                 }
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement