Swimming Record - Задача
Judge ми дава 80/100 , но не мога да разбера защо. Ако някой има идеи за проблема или решение, което judge e приел ще съм благодарен.
Ето го и кода:
package com.company;
import java.util.Scanner;
public class swimming {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double recordTime = Double.parseDouble(scanner.nextLine());
double recordDist = Double.parseDouble(scanner.nextLine());
double timePerMeter = Double.parseDouble(scanner.nextLine());
double time = timePerMeter * recordDist;
double timeDelay = recordDist / 15;
if (recordDist % 15 != 0) {
timeDelay = Math.floor(timeDelay);
}
double timeOVR=time + timeDelay*(12.5);
if(timeOVR <= recordTime) {
System.out.printf("Yes, he succeeded! The new world record is %.2f seconds.",timeOVR);
}
else if(timeOVR > recordTime) {
System.out.printf("No, he failed! He was %.2f seconds slower.",(timeOVR-recordTime));
}
}
}