Advertisement
Anamaria93

Untitled

Feb 25th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int hours = Integer.parseInt(scanner.nextLine());
  8. int minutes = Integer.parseInt(scanner.nextLine());
  9.  
  10. minutes = minutes + 15;
  11.  
  12. if (minutes > 59) {
  13. minutes = minutes - 60;
  14. hours = hours + 1;
  15. }
  16.  
  17. else if (hours >= 24)
  18. hours = hours - 24;
  19.  
  20. if (minutes < 10)
  21. System.out.println(hours + ":0" + minutes);
  22.  
  23. else
  24. System.out.println(hours + ":" + minutes);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement