Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
![](https://rs.olm.vn/images/avt/0.png?1311)
câu 2 bạn xem lại đề nhé
câu 1:
bước 1: nhập n
bước 2: t:=0; i:=2;
bước 3: t:=t+1/i; i:=i+1;
bước 4: nếu i<=n thì quay lại bước 3
bước 5: xuất t
bước 6: kết thúc
![](https://rs.olm.vn/images/avt/0.png?1311)
program dgv;
uses crt;
var x,y,z,n,i: integer;
p,S,A: real;
begin
clrscr;
writeln('Nhap x: '); read(x);
writeln('Nhap y: '); read(y);
writeln('Nhap z: '); read(z);
writeln('Nhap n: '); read(n);
if x mod 2 = 0 then write (x,' la so chan') else writeln(x,'la so le');
if y mod 2 = 0 then write (y,' la so chan') else writeln(y,'la so le');
if z mod 2 = 0 then write (z,' la so chan') else writeln(z,'la so le');
if n mod 2 = 0 then write (n,' la so chan') else writeln(n,'la so le');
if n mod 3 <> 1 then writeln('Tong khong co quy luat') else
begin
S:=0;
for i:= 0 to (n-1)/3 do
S:= S+(3i+1);
writeln('S = ',S);
A:=0;
p:=1;
for i:=1 to n do
begin
p:= p*(x/(x+y));
A:=A+p;
end;
writeln('A = ',A);
readln
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+1/i;
writeln('tong nghich dao cac so tu 1 toi ',n,' la: ',s:4:2);
readln;
end.
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+1/i;
writeln('tong nghich dao cac so tu 1 toi ',n,' la: ',s:4:2);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Bài 1:
uses crt;
var n,i,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=0 to n do
if i mod 2=0 then t:=t+a[i];
writeln('Tong cac so chan nho hon hoac bang ',n,' la: ',t);
readln;
end.
Bài 2:
uses crt;
var i,n,dem:integer;
begin
clrscr;
repeat
write('Nhap n=');readln(n);
until n>0;
dem:=0;
for i:=0 to n do
if i mod 3=0 then inc(dem);
writeln('So so chia het cho 3 nho hon hoac bang ',n,' la: ',dem);
readln;
end.
Bài 3:
uses crt;
var a:real;
n,i:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n>0;
a:=0;
for i:=1 to n do
a:=a+1/(i*(2*i+1));
writeln('Ket qua la: ',a:4:2);
readln;
end.
Bài 4:
uses crt;
var n,i,kt:integer;
begin
clrscr;
Repeat
write('Nhap n='); readln(n);
Until n>1;
kt:=0;
for i:=2 to n-1 do
if n mod i=0 then kt:=1;
if kt=0 then writeln(n,' la so nguyen to')
else writeln(n,' khong la so nguyen to');
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var s:real;
n,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+1/i;
i:=i+2;
end;
writeln('S=',s:4:2);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
1 : có trong sgk
3:
a) b1: T←0;
B2: 1 → n ;
B3 : T:=T+1/(i*i) ;
B4: Kết thúc
var a:array[1..32000] of integer;
i,n,j,tam:integer;
begin
write('nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i] > a[j] then
begin
tam:=a[i]; a[i]:=a[j]; a[j]:=tam;
end;
writeln('ket qua sap xep la:');
for i:=1 to n do write(A[i]:5);
readln
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var a,t1,i:integer;
t:real;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=2 to n do
t:=t+1/i;
writeln('T=',t:4:2);
write('Nhap so t='); readln(t1);
a:=0;
for i:=1 to t1 do
a:=a+i;
writeln(a);
readln;
end.
Program bt;
Var n,i: Integer;
T: longint;
Begin
Writeln('Nhap a');
Readln(a);
For i:=2 to n do T=T+1/i;
Writeln(' T=',T);
Readln;
End.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
write('Nhap n='); readln(n);
s:=1;
for i:=1 to n do
s:=s+1/(i+(i+2));
writeln('Ket qua la: ',s:4:2);
readln;
end.
Nguyễn Minh Lệ em xin lỗi ạ, em sửa là : longint;
b)
program hotrotinhoc;
var s: real;
i,n: byte;
function t(x: byte): longint;
var j: byte;
t1: longint;
begin
t1:=1;
for j:=1 to x do
t1:=t1*j;
t1:=t;
end;
begin
readln(n);
s:=0;
for i:=1 to n do
s:=s+1/t(i);
write(s:1:2);
readln
end.
c) Đề em ghi sai rồi thế này với đúng :
\(T=1+\frac{2}{2^2}+\frac{3}{3^2}+\frac{4}{4^2}+...+\frac{n}{n^2}\)
program hotrotinhoc;
var t: real;
n,i: byte;
begin
readln(n);
t:=0;
for i:=1 to n do
t:=t+i/(i*i);
write(t:1:2);
readln
end.