Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ConditionalStatementsExcercises;
- import java.util.Scanner;
- public class TimeAnd15Min {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int h = Integer.parseInt(scanner.nextLine());
- int m = Integer.parseInt(scanner.nextLine());
- int mm = m + 15;
- if (mm > 59) {
- mm = mm % 60;
- h = h + 1;
- }
- if (h > 23) {
- h = h -24;
- }
- System.out.printf("%d:%02d", h, mm);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement