viết chương trình
A=1+\(\dfrac{1}{4.5}\)+ ...... + \(\dfrac{1}{n^2\left(n^2+1\right)}\)
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.
Thuật toán:
Bước 1: Nhập n
Bước 2: i←1; a←0;
Bước 3: a←a+1/(i*(i+2));
Bước 4: i←i+1;
Bước 5: Nếu i<=n thì quay lại bước 3
Bước 6: xuất a
Bước 7: Kết thúc
Viết chương trình:
uses crt;
var a:real;
i,n:longint;
begin
clrscr;
write('Nhap n='); readln(n);
a:=0;
for i:=1 to n do
a:=a+1/(i*(i+2));
writeln(a:4:2);
readln;
end.
\(\lim\dfrac{\left(-3\right)^n-4.5^{n+1}}{2.4^n+3.5^n}=\lim\dfrac{\left(-3\right)^n+20.5^n}{2.4^n+3.5^n}=\lim\dfrac{\left(-\dfrac{3}{5}\right)^n+20}{2\left(\dfrac{4}{5}\right)^n+3}=\dfrac{0+20}{0+3}=\dfrac{20}{3}\)
\(\lim\dfrac{2^n-3^n+4.5^{n+2}}{2^{n+1}+3^{n+2}+5^{n+1}}=\lim\dfrac{2^n-3^n+100.5^n}{2.2^n+9.3^n+5.5^n}=\lim\dfrac{\left(\dfrac{2}{5}\right)^n-\left(\dfrac{3}{5}\right)^n+100}{2\left(\dfrac{2}{5}\right)^n+9\left(\dfrac{3}{5}\right)^n+5}=\dfrac{100}{5}=20\)
var i,n:integer;
tich:real;
begin
write('nhap n='); readln(n);
tich:=1;
for i:=1 to n do tich:=tich*(1+1/(i*i));
write('ket qua la:',tich);
readln
end.
Giải:
\(C=\left(1-\dfrac{2}{2.3}\right)\left(1-\dfrac{2}{3.4}\right)\left(1-\dfrac{2}{4.5}\right)...\left(1-\dfrac{2}{n\left(n+1\right)}\right)\)
Đk: \(n\ne0;n\ne-1\)
\(C=\left(1-\dfrac{2}{2.3}\right)\left(1-\dfrac{2}{3.4}\right)\left(1-\dfrac{2}{4.5}\right)...\left(1-\dfrac{2}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\left(\dfrac{2.3-2}{2.3}\right)\left(\dfrac{3.4-2}{3.4}\right)\left(\dfrac{4.5-2}{4.5}\right)...\left(\dfrac{n\left(n-1\right)-2}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\dfrac{4}{2.3}.\dfrac{10}{3.4}.\dfrac{18}{4.5}...\left(\dfrac{n\left(n-1\right)-2}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\dfrac{1.4}{2.3}.\dfrac{2.5}{3.4}.\dfrac{3.6}{4.5}...\left(\dfrac{\left(n-1\right)\left(n+2\right)}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\dfrac{1.4.2.5.3.6...\left(n-1\right)\left(n+2\right)}{2.3.3.4.4.5.n\left(n+1\right)}\)
\(\Leftrightarrow C=\dfrac{\left[1.2.3...\left(n-1\right)\right]\left[4.5.6\left(n+2\right)\right]}{\left(2.3.4...n\right)\left[3.4.5....\left(n+1\right)\right]}\)
\(\Leftrightarrow C=\dfrac{n+2}{3n}\)
Vì \(\dfrac{n+2}{3n}< \dfrac{2n+2}{3n}\)
\(\Leftrightarrow C< \dfrac{2n+2}{3n}\)
Vậy ...
Giải:
\(C=\left(1-\dfrac{2}{2.3}\right)\left(1-\dfrac{2}{3.4}\right)\left(1-\dfrac{2}{4.5}\right)...\left(1-\dfrac{2}{n\left(n+1\right)}\right)\)
Đk: \(n\ne0;n\ne-1\)
\(C=\left(1-\dfrac{2}{2.3}\right)\left(1-\dfrac{2}{3.4}\right)\left(1-\dfrac{2}{4.5}\right)...\left(1-\dfrac{2}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\left(\dfrac{2.3-2}{2.3}\right)\left(\dfrac{3.4-2}{3.4}\right)\left(\dfrac{4.5-2}{4.5}\right)...\left(\dfrac{n\left(n-1\right)-2}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\dfrac{4}{2.3}.\dfrac{10}{3.4}.\dfrac{18}{4.5}...\left(\dfrac{n\left(n-1\right)-2}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\dfrac{1.4}{2.3}.\dfrac{2.5}{3.4}.\dfrac{3.6}{4.5}...\left(\dfrac{\left(n-1\right)\left(n+2\right)}{n\left(n+1\right)}\right)\)
\(\Leftrightarrow C=\dfrac{1.4.2.5.3.6...\left(n-1\right)\left(n+2\right)}{2.3.3.4.4.5.n\left(n+1\right)}\)
\(\Leftrightarrow C=\dfrac{\left[1.2.3...\left(n-1\right)\right]\left[4.5.6\left(n+2\right)\right]}{\left(2.3.4...n\right)\left[3.4.5....\left(n+1\right)\right]}\)
\(\Leftrightarrow C=\dfrac{n+2}{3n}\)
Vì \(\dfrac{n+2}{3n}< \dfrac{2n+2}{3n}\)
\(\Leftrightarrow C< \dfrac{2n+2}{3n}\)
Vậy ...
uses crt;
var b:array[1..100] of integer;
i,n,d:integer;
begin
clrscr;
repeat
writeln('nhap n=');readln(n);
until n>0;
for i:=1 to n do
begin writeln('b[',i,']','=');readln(b[i]);end;
writeln('so cac so le la');
for i:=1 to n do
if b[i] mod 2<>0 then d:=d+1;
writeln(d);readln;end.
uses crt;
var n,i:longint; s:real;
begin
clrscr;
s:=0;
writeln('nhap vao n=');readln(n);
writeln('tong cua A la');
for i:=1 to n do
s:=s + 1/(i*(i+2));
writeln(s:4:3);readln;end.
program 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+2));
writeln('Tong la ',s);
readln
end.
của Trương Quang Dũng thiếu uses crt;
ko khai báo s.
có 2 dấu ngoặc liên tiếp nên chương trình sẽ bị lỗi
program bai1;
var s,n:longint;
begin
write('N= ');readln(n);
s:=1;
for i:=2 to n do
s:=s+1/(sqr(i)*(sqr(i)+1);
write('s= ',s);
readln
end.