tính tổng s=1/1+1/2+...+1/n-1+1/n

2 câu trả lời

uses crt;

var n,i,s: integer;

begin

clrscr;

i:=0;

s:=0;

while i<n do begin

i:=i+1;

s:=s+1/i;

end;

writeln('tong s=',s);

readln

end.

uses crt;

var n,i,s: integer;

begin

clrscr;

i:=0;

s:=0;

while i<n do begin

i:=i+1;

s:=s+1/i;

end;

writeln('tong s=',s);

readln

end.

$#Shi$

$\text{Xin ctlhn cho nhóm ạ}$