Advertisement
Spocoman

Skeleton

Sep 9th, 2024
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int minutes = Integer.parseInt(scanner.nextLine()),
  7.                 seconds = Integer.parseInt(scanner.nextLine()),
  8.                 control = minutes * 60 + seconds;
  9.         double lengthInMeters = Double.parseDouble(scanner.nextLine()),
  10.                 secondsFor100Meters = Double.parseDouble(scanner.nextLine()),
  11.                 time = lengthInMeters / 100 * secondsFor100Meters - lengthInMeters / 120 * 2.5;
  12.  
  13.         if (time <= control) {
  14.             System.out.printf("Marin Bangiev won an Olympic quota!\nHis time is %.3f.\n", time);
  15.         } else {
  16.             System.out.printf("No, Marin failed! He was %.3f second slower.", time - control);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement