Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Created by Nasko on 16.7.2017 г..
- */
- public class TimePlus15 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int hours = Integer.parseInt(sc.nextLine());
- int minutes = Integer.parseInt(sc.nextLine());
- minutes+=15;
- if (minutes>59){
- hours+=1;
- minutes -=60;
- }
- if (hours>23) {
- if (minutes < 10) {
- System.out.printf("0:0%d", minutes);
- } else
- System.out.printf("0:%d", minutes);
- } else {
- if (minutes < 10) {
- System.out.printf("%d:0%d",hours, minutes);
- } else {
- System.out.printf("%d:%d", hours, minutes);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment