YavorGrancharov

SumSeconds

Dec 15th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class SumSeconds {
  3.     public static void main(String[] args) {
  4.         Scanner console = new Scanner(System.in);
  5.         int a = Integer.parseInt(console.nextLine());
  6.         int b = Integer.parseInt(console.nextLine());
  7.         int c = Integer.parseInt(console.nextLine());
  8.         int min = (a + b + c) / 60;
  9.         int sec = (a + b + c) % 60;
  10.         if (sec < 10) {
  11.             System.out.println(min + ":" + "0" + sec);
  12.         }else {
  13.             System.out.println(min + ":" + sec);
  14.         }
  15.     }
  16. }
Add Comment
Please, Sign In to add comment