Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int minutes = Integer.parseInt(scanner.nextLine()),
- seconds = Integer.parseInt(scanner.nextLine()),
- control = minutes * 60 + seconds;
- double lengthInMeters = Double.parseDouble(scanner.nextLine()),
- secondsFor100Meters = Double.parseDouble(scanner.nextLine()),
- time = lengthInMeters / 100 * secondsFor100Meters - lengthInMeters / 120 * 2.5;
- if (time <= control) {
- System.out.printf("Marin Bangiev won an Olympic quota!\nHis time is %.3f.\n", time);
- } else {
- System.out.printf("No, Marin failed! He was %.3f second slower.", time - control);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement