Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class task4_2 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int hours = Integer.parseInt(scanner.nextLine());
- int minutes = Integer.parseInt(scanner.nextLine());
- minutes = minutes +30;
- if (minutes > 59){
- hours = hours+1;
- minutes= minutes-60;
- }if (hours >23){
- hours = 0;
- }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
Advertisement