Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Bojinova {
- public static void main(String[] args)
- {
- Scanner in = new Scanner(System.in);
- System.out.print("First competitor time: ");
- int s1 = in.nextInt();
- System.out.print("Second competitor time: ");
- int s2 = in.nextInt();
- System.out.print("Third competitor time: ");
- int s3 = in.nextInt();
- int seconds = s1+ s2+ s3;
- int p1 = seconds % 60;
- int p2 = seconds / 60;
- int p3 = p2 % 60;
- p2 = p2 / 60;
- if (p1 < 10){
- System.out.print("Summed time: "+p3+":"+"0"+p1);
- }else if (p1 > 9) {
- System.out.print("Summed time: "+p3+":"+p1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement