Java实现 洛谷 P1035 级数求和-LMLPHP

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
Scanner in = new Scanner(System.in); double k = in.nextDouble(); double i = 1;
double sn = 0;
while(! (sn > k) ){
sn = sn + 1/i;
i++;
} System.out.println( (int)(i-1) );
} }
05-26 17:36