Advertisement
kaloyan99

Untitled

Jul 4th, 2021
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. package com.kloboshki;
  2.  
  3. import java.util.Map;
  4. import java.util.Scanner;
  5. import java.util.TreeMap;
  6.  
  7. public class Main {
  8.  
  9. public static void main(String[] args) {
  10. Scanner scanner = new Scanner(System.in);
  11. Map<String, String> phoneBook = new TreeMap<>();
  12. String input = "";
  13.  
  14. while (!(input = scanner.nextLine()).equals("")) {
  15. String[] line = input.split(" ");
  16. phoneBook.put(line[0], line[1]);
  17. }
  18. for (String key : phoneBook.keySet()) {
  19. System.out.println(phoneBook.get(key));
  20. }
  21. }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement