Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- String[] words = in.nextLine().split(" ");
- char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
- for (String word: words) {
- for (char letter: letters) {
- if (word.toLowerCase().charAt(0) == letter) {
- System.out.println(word);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement