Advertisement
tchenkov

L03u07_SumSeconds

Jan 18th, 2017
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * Created by todor on 17.01.2017 г..
  5.  */
  6. public class u07_SumSeconds {
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int time1 = Integer.parseInt(scan.nextLine());
  12.         int time2 = Integer.parseInt(scan.nextLine());
  13.         int time3 = Integer.parseInt(scan.nextLine());
  14.         int timeSum = time1 + time2 + time3;
  15.  
  16.         int minutes = timeSum / 60;
  17.         int seconds = timeSum % 60;
  18.  
  19.         System.out.printf("%d:%02d", minutes, seconds);
  20.  
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement