题解 | #牛牛的通勤#
牛牛的通勤
http://www.nowcoder.com/practice/1fe33d534843473eb086c4b42655e13d
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int d = scan.nextInt();
take(d);
}
public static void take(int d) {
//因为走路的时间就是我们输入的路程
//所以只需求出打车所需要的时间
int carTime;
if(d % 10 == 0) {
carTime = 10 + (d / 10);
} else {
carTime = 11 + (d / 10);
}
if(carTime < d) {
System.out.println("v");
} else {
System.out.println("w");
}
}
}
Java基础练习题 文章被收录于专栏
都是一些基础的语法题目,每天可以刷几道。
