NOIP2002 级数求和

program NOIPC1;

var
	n,k:longint;
	ans:real;

begin
	assign(input,'NOIPC1.in'); reset(input);
	assign(output,'NOIPC1.out'); rewrite(output);

	readln(k);
	ans:=1;
	n:=1;
	while ans<=k do
		begin
			inc(n);
			ans:=ans+1/n;
		end;
	writeln(n);

	close(input); close(output);
end.

你可能感兴趣的:(NOIP2002 级数求和)