Advertisement
plamen27

Time +15 min fixed Java

Oct 11th, 2016
224
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. public class Main {
  3.  
  4.  
  5. public static void main(String[] args) {
  6.  
  7. Scanner console = new Scanner(System.in);
  8.  
  9. int hour = Integer.parseInt(console.nextLine());
  10. int min = Integer.parseInt(console.nextLine());
  11. min = min + 15;
  12.  
  13. if (min >= 60)
  14. {
  15. min = min - 60;
  16. hour = hour + 1;
  17.  
  18. }
  19. if (hour>23)
  20. {
  21. hour -= 24;
  22.  
  23. }
  24. if (min < 10)
  25. {
  26. System.out.println(hour + ":" + "0" + min);
  27. }
  28. else
  29. {
  30. System.out.printf(hour + ":" + min);
  31.  
  32. }
  33.  
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement