P=(1-1/2)*(1-1/4)*(1-1/6)...(1-1/2n) помогите с помощью цикла (while , repeat)
Answers & Comments
iolandavalerypad353
Begin var n := ReadlnInteger('n ='); var p := 1.0; var i := 1; while (i <= n) do begin p *= (1 - 1/(2 * i)); i += 1; end; p.Println; end.
Answers & Comments
var n := ReadlnInteger('n =');
var p := 1.0;
var i := 1;
while (i <= n) do begin
p *= (1 - 1/(2 * i));
i += 1;
end;
p.Println;
end.