Advertisement
Guest User

Index

a guest
May 30th, 2016
1,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace IndexOfLetters
  4. {
  5. class IndexOfLetters
  6. {
  7. static void Main(string[] args)
  8. {
  9. string[] alphabet = new string[]
  10. {
  11. "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"
  12. };
  13.  
  14. string input = Console.ReadLine();
  15.  
  16. for (int j = 0; j < input.Length; j++)
  17. {
  18. for (int i = 0; i < alphabet.Length; i++)
  19. {
  20. if (input[j].ToString().Contains(alphabet[i]))
  21. {
  22. Console.WriteLine("{0} -> {1}", input[j], i);
  23. }
  24. }
  25. }
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement