Advertisement
Guest User

Untitled

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