Advertisement
Mariyan17320

Bojinova

Apr 15th, 2020
153
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.*;
  2. public class Bojinova {
  3.     public static void main(String[] args)
  4.     {
  5.         Scanner in = new Scanner(System.in);
  6.         System.out.print("First competitor time: ");
  7.         int s1 = in.nextInt();
  8.         System.out.print("Second competitor time: ");
  9.         int s2 = in.nextInt();
  10.         System.out.print("Third competitor time: ");
  11.         int s3 = in.nextInt();
  12.  
  13.         int seconds = s1+ s2+ s3;
  14.         int p1 = seconds % 60;
  15.        int p2 = seconds / 60;
  16.         int p3 = p2 % 60;
  17.         p2 = p2 / 60;
  18.         if (p1 < 10){
  19.             System.out.print("Summed time: "+p3+":"+"0"+p1);
  20.         }else if (p1 > 9) {
  21.             System.out.print("Summed time: "+p3+":"+p1);
  22.     }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement