题解 | #ASCII码#
KiKi和酸奶
http://www.nowcoder.com/practice/c7721f3a1b1a47a783974453e82cadbb
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); String str = in.nextLine(); String []s = str.split("[ ]"); double n = Double.parseDouble(s[0]); double h = Double.parseDouble(s[1]); double m = Double.parseDouble(s[2]); double d =n-(m/h);//用double类型的,计算出现小数部分说明喝完一整数瓶而且开了一瓶在喝中,用总数去减除法得出的小数,得到的是剩余的小数直接用int取整即可 System.out.println((int)d); } }