Advertisement
veronikaaa86

sum sec

Nov 18th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SumSeconds01 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int athlete1 = Integer.parseInt(scanner.nextLine());
  8. int athlete2 = Integer.parseInt(scanner.nextLine());
  9. int athlete3 = Integer.parseInt(scanner.nextLine());
  10.  
  11. int allTime = athlete1+athlete2+athlete3;
  12.  
  13. int min = allTime/60;
  14. int sec = allTime%60;
  15.  
  16. System.out.printf("%d:%02d", min, sec);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement