题解 | #牛牛的快递#
牛牛的快递
http://www.nowcoder.com/practice/41b42e7b3c3547e3acf8e90c41d98270
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); double kg=sc.nextDouble(); char b=sc.next().charAt(0); int price=0; if(kg<=1){ price=20; }else{ price=20+(int)(kg-0.1); } if(b=='y'){ System.out.println(price+5); }else{ System.out.println(price); } } }