A) A)A)A)PROGRAM BAIBAIBAI5A;BAI5A;5A;5A; PROGRAM PROGRAM PROGR...
Bài 5.
a)
a)
a)
a)
Program bai
bai
bai5a;
bai
5a;
5a;
5a;
Program
Program
Program
Uses crt;
Uses crt;
Uses crt;
Uses crt;
Const n=50;
Const n=50;
Const n=50;
Const n=50;
Var i: integer;
Var i: integer;
Var i: integer;
Var i: integer;
Y:real;
Y:real;
Begin
Begin
Begin
Begin
Clrscr;
Clrscr;
for i:=1 to n do
for i:=1 to n do
Y:=i/(i+1);
Y:=i/(i+1);
Write('Tong Y: ',y
Write('Tong Y: ',y:9:3
:9:3
:9:3);
:9:3
);
);
);
Readln
Readln
End
End
End
End.
.
.
.
Ví Dụ
Ví Dụ
Ví Dụ
Ví Dụ
b)
b)
b)
b)
progr
program
am
am bai
am
bai
bai5b;
bai
5b;
5b;
5b;
progr
progr
uses crt;
uses crt;
uses crt;
uses crt;
var
var
var
var
n:longint;
n:longint;
n:longint;
n:longint;
e,sh:real;
e,sh:real;
begin
begin
begin
begin
clrscr;
clrscr;
clrscr;
clrscr;
sh:=1/2;
sh:=1/2;
sh:=1/2;
sh:=1/2;
n:=2;
n:=2;
n:=2;
n:=2;
Great by: Nguyễn Trọng Hoàng Email: [email protected]
e:=2+sh;
e:=2+sh;
e:=2+sh;
e:=2+sh;
while sh>=2*1e
while sh>=2*1e-
-
-
-16 do
16 do
16 do
16 do
while sh>=2*1e
while sh>=2*1e
begin
begin
begin
begin
n:=n+1;
n:=n+1;
n:=n+1;
n:=n+1;
sh:=sh*(1/n);
sh:=sh*(1/n);
sh:=sh*(1/n);
sh:=sh*(1/n);
e:=e+sh;
e:=e+sh;
e:=e+sh;
e:=e+sh;
end
end;
end
end
;
;
;
writeln('Gia tri e(n) la: ',e:10:6);
writeln('Gia tri e(n) la: ',e:10:6);
writeln('Gia tri e(n) la: ',e:10:6);
writeln('Gia tri e(n) la: ',e:10:6);
readln
readln
readln
readln
end.
.
.
.
end
end
end
Bài
Bài
Bài