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