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 a = Integer.parseInt(scanner.nextLine());
- int b = Integer.parseInt(scanner.nextLine());
- int c = Integer.parseInt(scanner.nextLine());
- int sum = a + b + c;
- int minute = sum / 60;
- int seconds = sum % 60;
- System.out.print(minute + ":");
- if (seconds < 10) {
- System.out.println("0" + seconds);
- } else {
- System.out.println(seconds);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement