Advertisement
kaloyan99

Untitled

Mar 2nd, 2021
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. Scanner scanner = new Scanner(System.in);
  2.  
  3.         String our = scanner.next();
  4.         String time = scanner.next();
  5.  
  6.         if ((time.equals("PM") && our.charAt(0) >= '1')) {
  7.             if (our.charAt(0) == '1' && our.charAt(1) == '2') {
  8.                 System.out.println("non-beer time");
  9.             } else System.out.println("beer time");
  10.         } else if (time.equals("AM") && our.charAt(0) == '0' && our.charAt(1) < '3') {
  11.             System.out.println("beer time");
  12.         } else System.out.println("non-beer time");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement