Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Y01SumSeconds {
- public static void main(String [] Args) {
- Scanner scanner = new Scanner(System.in);
- int player1 = Integer.parseInt(scanner.nextLine());
- int player2 = Integer.parseInt(scanner.nextLine());
- int player3 = Integer.parseInt(scanner.nextLine());
- int sumSeconds = player1 + player2 + player3;
- int minutes = sumSeconds / 60;
- int seconds = sumSeconds % 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