Составьте программу S=1/a+1/a^2+1/a^3+...+1/a^2n-2 Пожалуйста!!!! Очень срочно!!!!
Answers & Comments
emblerik
Var n, i : integer; a, s, k : real; begin read (a, n); s := 0; k := a; for i := 1 to 2 * n - 2 do begin s := s + (1 / k); k := k * a; end; write (s); end.
Answers & Comments
n, i : integer;
a, s, k : real;
begin
read (a, n);
s := 0;
k := a;
for i := 1 to 2 * n - 2 do
begin
s := s + (1 / k);
k := k * a;
end;
write (s);
end.