Advertisement
Ivakis

Time +15 Minutes

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