Advertisement
borkins

07a. Sum Seconds

Mar 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. /*
  2.  * Simple Conditions
  3.  */
  4. import java.util.Scanner;
  5.  
  6. public class _07a_SumSeconds
  7. {
  8.     public static void main(String[] args)
  9.     {
  10.         Scanner scan = new Scanner(System.in);
  11.  
  12.         int firstTime = Integer.parseInt(scan.nextLine());
  13.         int secondTime = Integer.parseInt(scan.nextLine());
  14.         int thirdTime = Integer.parseInt(scan.nextLine());
  15.  
  16.         int totalTimeSeconds = firstTime + secondTime + thirdTime;
  17.  
  18.         System.out.printf("%d:%02d", (totalTimeSeconds / 60), (totalTimeSeconds % 60));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement