Перевод программы С++ на Паскаль! #include #include const float e = 0.0001; int main() { float x; std::cin >> x; float a = (x - 1 ) / x; float s = a; int n = 2; do { a *= (x - 1 ) / x * (n - 1) / n; s += a ; n++ ; } while ( a > e / n ); std::cout << log( x ) << " " << s << std::endl; system( "pause" ); return 0; }
program Logarithm;
uses
Math;
const
e = 0.0001;
var
x, a, s: real;
n: integer;
begin
readln(x);
a := (x - 1) / x;
s := a;
n := 2;
repeat
a := a (x - 1) / x (n - 1) / n;
s := s + a;
n := n + 1;
until a < e / n;
writeln(ln(x), ' ', s);
readln;
end.