Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class LettersToIndex {
- public static void main(String[] args) {
- String[] alphabet = new String[] { "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" };
- Scanner scanner = new Scanner(System.in);
- String line = scanner.nextLine().toLowerCase();
- String lineArgs[] = line.split("");
- for (int i = 0; i < lineArgs.length; i++) {
- System.out.println(lineArgs[i] + " -> " + Arrays.asList(alphabet).indexOf(lineArgs[i]));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement