Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Alphabet
- {
- static void Main()
- {
- int[] alpha = new int[26];
- for (int index = 0; index < alpha.Length; index++)
- {
- alpha[index] = 'a' + index;
- }
- Console.Write("Write a word: ");
- string word = Console.ReadLine();
- for (int letters = 0; letters < word.Length; letters++)
- {
- for (int index = 0; index < alpha.Length; index++)
- {
- if (word[letters]==alpha[index])
- {
- Console.Write(index+ " ");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement