program tinhtong; uses crt; var n,i:integer; s:real; begin clrscr; write(‘Nhap n: ‘); readln(n); s:=0; for i:=1 to n do s:=s+1/i; write(‘Tong la: ‘,s); readln end. Bình luận
program phuongt; uses crt; var n, i: integer; s: real; begin clrscr; write(‘Nhap n = ‘); readln(n); s:=0; for i:=1 to n do s:=s+1/i; write(‘S = ‘, s:3:1); readln end. Bình luận
program tinhtong;
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
write(‘Nhap n: ‘); readln(n);
s:=0;
for i:=1 to n do
s:=s+1/i;
write(‘Tong la: ‘,s);
readln
end.
program phuongt;
uses crt;
var n, i: integer;
s: real;
begin
clrscr;
write(‘Nhap n = ‘); readln(n);
s:=0;
for i:=1 to n do s:=s+1/i;
write(‘S = ‘, s:3:1);
readln
end.