Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Numerics;
  7.  
  8.  
  9. namespace Revision
  10. {
  11.     class ContinueTest
  12.     {
  13.         static void Main()
  14.         {
  15.             string input = Console.ReadLine().ToLower();          
  16.  
  17.             char[] letters = input.ToCharArray();
  18.  
  19.             string alphabet = "abcdefghijklmnopqrstuvwxyz";
  20.             char[] alphabetArray = alphabet.ToCharArray();
  21.  
  22.             int result = 0;
  23.             for (int i = 0; i < letters.Length; i++)
  24.             {
  25.                 for (int j = 0; j < alphabetArray.Length; j++)
  26.                 {
  27.                     if (letters[i] == alphabetArray[j])
  28.                     {
  29.                         result = j;
  30.                         Console.WriteLine("{0} -> {1}", letters[i], result);
  31.                     }
  32.                 }
  33.                
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement