Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class p02 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double record = Double.parseDouble(scanner.nextLine());
- double meters = Double.parseDouble(scanner.nextLine());
- double seconds = Double.parseDouble(scanner.nextLine());
- double ivanchosek = meters * seconds;
- double addTime = Math.floor(meters / 15.0) * 12.5;
- double totalTIme = ivanchosek + addTime;
- if(record <= totalTIme){
- System.out.printf("No, he failed! He was %.2f seconds slower.", totalTIme - record);
- }else{
- System.out.printf("Yes, he succeeded! The new world record is %.2f seconds.", totalTIme);
- }
- }
- }
Add Comment
Please, Sign In to add comment