题解 | #牛牛的快递#
牛牛的快递
http://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int price = 0;
float weight = scanner.nextFloat();
char ch = scanner.next().charAt(0);
if((int) (weight * 10) % 10 == 0){
price = 20 + ((int) weight - 1);
}else{
price = 20 + (int) weight;
}
if(ch == 'y'){
price += 5;
}
System.out.print(price);
}
}
360集团公司福利 411人发布