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);
- double record = Double.parseDouble(scanner.nextLine()),
- meters = Double.parseDouble(scanner.nextLine()),
- secondPerMeter = Double.parseDouble(scanner.nextLine()),
- score = meters * secondPerMeter + (int) (meters / 50) * 30;
- if (score < record) {
- System.out.printf("Yes! The new record is %.2f seconds.\n", score);
- } else {
- System.out.printf("No! He was %.2f seconds slower.\n", score - record);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement