HDACM 1408
注意:浮点型不能直接用v<0来判断是否小于0
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);while (sc.hasNext()) {double v = sc.nextDouble();double d = sc.nextDouble();int count = 0;double i = 1;boolean b = false;while(true){for (int j = 0; j < i; j++) {v -= d;count++;if (v-0.000001<0) {
//浮点型不能直接用v<0b = true;break;}}if (b) {break;}count++;i++;}System.out.println(count);}sc.close();}
}