Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.lang.String;
- public class SecondsSum{
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int a = Integer.parseInt(console.nextLine());
- int b = Integer.parseInt(console.nextLine());
- int c = Integer.parseInt(console.nextLine());
- int timeSum = a + b + c;
- if(timeSum <10){
- System.out.println("0:0" + timeSum);
- }else if(timeSum >= 10 && timeSum <= 59){
- System.out.println("0:" + timeSum);
- }else if(timeSum >= 60 && timeSum <= 119){
- System.out.println("1:0"+ (timeSum - 60));
- }else if(timeSum >= 120 && timeSum <= 179){
- System.out.println("2:0" + (timeSum - 120));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment