Advertisement
-and_

Untitled

Mar 31st, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1.  Scanner scanner = new Scanner(System.in);
  2.         int hours = Integer.parseInt(scanner.nextLine());
  3.         int minutes = Integer.parseInt(scanner.nextLine());
  4.         if(minutes <= 44) {
  5.            minutes = minutes + 15;
  6.             System.out.printf( " %d:%d" , hours , minutes ) ;
  7.         }
  8.         else {
  9.             hours = hours + 1 ;
  10.             minutes = 15 - (60 - minutes );
  11.             System.out.printf( "%d:%d" , hours , minutes) ;
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement