Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- char[] lettersArray = new char[2 * 26];
- for (int i = 0; i < 26; i++) // Create array from upper and lower characters
- {
- char uppperChar = (char) ('A' + i);
- char lowerChar = (char)('a' + i);
- lettersArray[i] = uppperChar;
- lettersArray[26 + i] = lowerChar;
- }
- string word = Console.ReadLine(); // Input
- for (int i = 0; i < word.Length; i++)
- {
- int indexOfCurrentCharacter = Array.IndexOf(lettersArray, word[i]);
- Console.WriteLine(word[i] + " at position " +indexOfCurrentCharacter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement