Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int first = Integer.parseInt(console.nextLine());
- int second = Integer.parseInt(console.nextLine());
- int third = Integer.parseInt(console.nextLine());
- // за секунди ,съм дал рандом числа
- int total = first + second + third;
- int mins = 0;
- if(total > 59 && total <= 119) {
- mins++;
- total -= 60;
- } else if (total > 120) {
- mins += 2;
- total -= 120;
- }
- System.out.printf("%d:%02d", mins, total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement