var k,i,n:integer;
s1,s:real;
begin
k:=0;
n:=0;
s:=0;
s1:=1;
while s1>0.002 do
s:=s+s1;
s1:=1/(n+(n+1));
k:=k+1;
n:=n+1;
end;
writeln(s-1:5:5,' ',k-1);
end.
Program n_1;
var m, n: double; i:integer;
i:=0;
m:=1;
while (m>=0.002) do begin
m:=1/(n+n+1);
i:=i+1;
writeln(i-1);
Ответ: 250
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var k,i,n:integer;
s1,s:real;
begin
k:=0;
n:=0;
s:=0;
s1:=1;
while s1>0.002 do
begin
s:=s+s1;
s1:=1/(n+(n+1));
k:=k+1;
n:=n+1;
end;
writeln(s-1:5:5,' ',k-1);
end.
Program n_1;
var m, n: double; i:integer;
begin
i:=0;
n:=0;
m:=1;
while (m>=0.002) do begin
m:=1/(n+n+1);
i:=i+1;
n:=n+1;
end;
writeln(i-1);
end.
Ответ: 250