import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double n = sc.nextDouble(); while (n!=0) { double sum = 0; int i = 2; if(n==0) break; while (sum < n) { sum = 1.0 / i + sum;//////最关键的一步就是这一步 太关键了 一定要用1.0 i++; } System.out.println(i - 2 + " card(s)"); n = sc.nextDouble(); } } }