Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Simple Conditions
- */
- import java.util.Scanner;
- public class _07b_SumSeconds
- {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- int totalSeconds = 0;
- // Using 'for' loop to input and sum all seconds
- for (int i = 0; i < 3; i++) {
- totalSeconds += Integer.parseInt(scan.nextLine());
- }
- System.out.printf("%d:%02d", (totalSeconds / 60), (totalSeconds % 60));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement