Cycling and walking

On the campus of Peking University, without a bicycle, it would be very inconvenient to run errands in class. But in fact, it is not necessary to ride a bicycle fast to do everything, because when riding a bicycle, you always have to find the car, unlock, park, lock the car, etc., which will take some time. Time. Assuming that the time to find the bicycle, unlock it and get on the bicycle is 27 seconds; the time to park and lock the car is 23 seconds; the walking time is 1.2 meters per second, and the cycling time is 3.0 meters per second. Please judge whether it is faster to ride a bike or walk faster when you travel different distances to run errands.
Input
Enter a line, including an integer, which indicates the distance to travel for one time, the unit is meters.
Output
Output a line, if riding fast, output a line of "Bike"; if walking fast, output a line of "Walk"; if the same speed, output a line of "All".
Sample input
120

Sample output
Bike

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        int n;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int timeb=0,timef=0;
        timeb=50+n/3;
        timef=(int)(n/1.2);
        if(timeb>timef)
            System.out.println("Walk");
        else if(timeb<timef)
            System.out.println("Bike");
        else if(timeb==timef)
            System.out.println("All");

    }

}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326586034&siteId=291194637