Advertisement
Alexandar17103

Untitled

Mar 30th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner console = new Scanner(System.in);
  6. int first = Integer.parseInt(console.nextLine());
  7. int second = Integer.parseInt(console.nextLine());
  8. int third = Integer.parseInt(console.nextLine());
  9. // за секунди ,съм дал рандом числа
  10. int total = first + second + third;
  11. int mins = 0;
  12. if(total > 59 && total <= 119) {
  13. mins++;
  14. total -= 60;
  15. } else if (total > 120) {
  16. mins += 2;
  17. total -= 120;
  18. }
  19. System.out.printf("%d:%02d", mins, total);
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement