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.
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.
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.
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.
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.
Uses crt;
Var a,b,S1,S2,S: real ;
Begin
Write ('Nhap a: '); readln (a);
Write('Nhap b: '); readln (b);
S1:=2*a*b;
S2:= (3.14*b*sqr(a))/2;
S:= S1+S2;
If (a<>0) and (b<>0) then Write (S);
Readln ;
End.
uses crt;
var a,b,s1:integer;
s2,s:real;
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
s1:=2*a*b;
s2:=(sqr(a)*b*pi))/2;
s:=s1+s2;
writeln(s:4:2);
readln;
end.
progrỉnam bai1;
var n,i:longint;
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.
1) 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.
var i,n:integer;
s:real;
begin
s:=1;
write('ban hay nhap vao mot so nguyen: '); readln(n);
for i:= 1 to n do
s:= s + (1/(i*(i+1));
writeln(' tong s = ',s:0:2);
readln
end.
var i,n:integer;
s:real;
begin
s:=1;
write('ban hay nhap vao mot so nguyen: '); readln(n);
for i:= 1 to n do
s:= s + (1/(i*(i+1));
writeln(' tong s = ',s:0:2);
readln
end.
ko phải do bạn lập trình hơi chệch choạng đâu mà do nó khó đó
à có vẻ hơi khó thiệt để ngĩ đã