Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package L02ConditionalStatements;
- import java.util.Scanner;
- public class P01SumSeconds {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int firstSeconds = Integer.parseInt(scanner.nextLine());
- int secondSeconds = Integer.parseInt(scanner.nextLine());
- int thirdSeconds = Integer.parseInt(scanner.nextLine());
- int sumSeconds = firstSeconds + secondSeconds + thirdSeconds;
- int minutes = sumSeconds / 60;
- int seconds = sumSeconds % 60;
- if (seconds < 10){
- System.out.printf("%d:0%d", minutes, seconds);
- }else {
- System.out.println(minutes + ":" + seconds);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement