var n,i:integer;
s:real;
begin
write('n=');readln(n);
s:=0;
for i:=1 to n do s:=s+(1/(i*(i+1)));
writeln(' Tong la: ',s);
readln;
end.
2) var n,i:integer;
s:real;
begin
write('n=');readln(n);
s:=0;
for i:=1 to n do s:=s+(1/((2*i)-1));
writeln(' Tong la: ',);
readln;
end.
sửa đề: S = \(1+\dfrac{1}{2.3}+\dfrac{2}{3.4}+...+\dfrac{n}{\left(n+1\right).\left(n+2\right)}\)
var i,n:integer;
s:real;
begin
write('Nhap n = ');readln(n);
s:=1;
for i:=1 to n do
s:=s+i/((i+1)*(i+2));
write('S = ',s:10:2);
readln;
end.