Advertisement
desislava_topuzakova

Untitled

Sep 21st, 2022
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package ExcersiseProverki;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SumSeconds {
  6. public static void main(String[] args) {
  7.  
  8. Scanner scanner = new Scanner(System.in);
  9.  
  10. int Player1 = Integer.parseInt(scanner.nextLine());
  11. int Player2 = Integer.parseInt(scanner.nextLine());
  12. int Player3 = Integer.parseInt(scanner.nextLine());
  13.  
  14. int Sum = Player1 + Player2 + Player3;
  15.  
  16. int minutes = Sum / 60;
  17. int seconds = Sum % 60;
  18.  
  19. if (seconds < 10) {
  20. System.out.printf("%d:0%d,", minutes , seconds );
  21. } else {
  22. System.out.printf("%d:%d", minutes , seconds );
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement