Advertisement
peterbodlev

Java_Lesson3_Seconds

Apr 29th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MinutesSport {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int finish1 = Integer.parseInt(scan.nextLine());
  8.         int finish2 = Integer.parseInt(scan.nextLine());
  9.         int finish3 = Integer.parseInt(scan.nextLine());
  10.         int finish = finish1 + finish2 + finish3;
  11.  
  12.         if (finish % 60)
  13.  
  14.         if (finish >= 0 && finish <= 59) {
  15.             System.out.println("0:" + finish);
  16.         } else if (finish >= 60 && finish <=119) {
  17.             System.out.println("1:" + (finish - 60));
  18.         } else if (finish >= 120 && finish <=179) {
  19.             System.out.println("2:" + (finish - 120));
  20.         }
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement