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