Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class LettersIndex
- {
- static void Main()
- {
- char[] alphabet = new char[26];
- for (int i = 0; i < 26; i++)
- {
- alphabet[i] = (char)(i + 97);
- }
- bool check = true;
- while (check)
- {
- char letter = Convert.ToChar(Console.Read());
- if (letter == '\r' || letter == '\n' )
- {
- check = false;
- break;
- }
- for (int i = 0; i < alphabet.Length; i++)
- {
- if (letter == alphabet[i])
- {
- Console.Write(i+1 + " ");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement