Advertisement
daegron

forAndrew

Sep 7th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public static void main(String[] args) {
  2. Scanner in = new Scanner(System.in);
  3. String[] words = in.nextLine().split(" ");
  4. char[] letters = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
  5. for (String word: words) {
  6. for (char letter: letters) {
  7. if (word.toLowerCase().charAt(0) == letter) {
  8. System.out.println(word);
  9. }
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement