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