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