dakata450

Untitled

Jul 14th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Skeleton {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int miutesKontrol = Integer.parseInt(scanner.nextLine());
  8. int secondsKontrol = Integer.parseInt(scanner.nextLine());
  9. double length = Double.parseDouble(scanner.nextLine());
  10. int secondsperhundret = Integer.parseInt(scanner.nextLine());
  11.  
  12. int finalKontrol = miutesKontrol * 60 + secondsKontrol;
  13.  
  14. double spaceMinus = length / 120;
  15. double minusTime = spaceMinus * 2.5;
  16.  
  17. double marinstime = (length / 100) * secondsperhundret - minusTime;
  18.  
  19. if (marinstime <= finalKontrol){
  20. System.out.printf("Marin Bangiev won an Olympic quota!%n");
  21. System.out.printf("His time is %.3f.", marinstime);
  22. }else {
  23. System.out.printf("No, Marin failed! He was %.3f second slower.", Math.abs(finalKontrol - marinstime));
  24. }
  25.  
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment