Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.text.DecimalFormat;
- import java.text.NumberFormat;
- import java.util.Locale;
- import java.util.Scanner;
- /**
- * Created by Losh17 on 5.8.2017 г..
- */
- public class TimePlus15minutes {
- public static void main(String[] args) {
- Locale.setDefault(new Locale("Us", "us"));
- Scanner console = new Scanner(System.in);
- Integer hour = Integer.parseInt(console.nextLine());
- Integer minutes = Integer.parseInt(console.nextLine());
- Integer temp = 0;
- NumberFormat numFormat = new DecimalFormat("#.##");
- if (minutes + 15 > 59){
- minutes = minutes + 15 - 60;
- hour = hour + 1;
- } else {
- minutes = minutes + 15;
- }
- if (hour > 23){
- hour = 0;
- }
- if (minutes < 10){
- System.out.println(hour + ":0" + minutes);
- } else {
- System.out.println(hour + ":" + minutes);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement