Viết chương trình tính tổng S=\(\frac{1}{100}\)+\(\frac{2}{100}\)+\(\frac{3}{100}\)...+\(\frac{100}{100}\)
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.
\(S=\frac{1}{100}-\frac{2}{100}+\frac{3}{100}-...-\frac{98}{100}+\frac{99}{100}-\frac{100}{100}\)
\(=\frac{1-2+3-...-98+99-100}{100}\)
\(=\frac{\left[\left(1-2\right)+\left(3-4\right)+...+\left(97-98\right)+\left(99-100\right)\right]}{100}\)
\(=\frac{-1-1-1-...-1}{100}=\frac{-1.50}{100}=\frac{-50}{100}=\frac{-1}{2}\)
Vậy S=\(\frac{-1}{2}\)
\(S=\frac{1}{100}-\frac{2}{100}+\frac{3}{100}-\frac{4}{100}+\frac{5}{100}-...-\frac{98}{100}+\frac{99}{100}\)
\(S=\frac{\left(1-2\right)+\left(3-4\right)+\left(5-6\right)+....+\left(97-98\right)+\left(99-100\right)}{100}\)
\(S=\frac{-1+\left(-1\right)+\left(-1\right)+.....+\left(-1\right)+\left(-1\right)}{100}\)
Từ 1 đến 100 có 100 số số hạng => Có 50 cặp => có 50 số (-1)
=> \(S=\frac{50\cdot\left(-1\right)}{100}=\frac{-50}{100}=\frac{-1}{20}\)
\(\frac{1}{2}A=\frac{1}{2}+\frac{3}{2^4}+\frac{4}{2^5}+...+\frac{100}{2^{101}}\)
\(A-\frac{1}{2}A=\frac{1}{2}+\frac{3}{2^3}+\frac{1}{2^4}+...+\frac{1}{2^{100}}-\frac{100}{2^{101}}\)
\(\frac{1}{2}A=\left(1-\frac{1}{2^{101}}\right)\div\frac{1}{2}-\frac{100}{2^{101}}\)
\(=\frac{2^{101}-1}{2^{100}}-\frac{100}{2^{101}}\)
\(\Rightarrow A=\frac{\left(2^{101}-1\right)}{2^{99}}-\frac{100}{2^{100}}\)
\(A=1+\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+...+\frac{1}{2^{99}}+\frac{1}{2^{100}}+\frac{1}{2^{100}}\)
=>\(2A=2+1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^{98}}+\frac{1}{2^{99}}+\frac{1}{2^{99}}\)
=>\(A=2A-A=2+\frac{1}{2^{99}}+\frac{1}{2^{99}}\)
\(A=2+\frac{1}{2^{98}}\)
Vậy: \(A=2+\frac{1}{2^{98}}\)
Gọi \(B=1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^{100}}\)
\(\Rightarrow2B=2+1+\frac{1}{2}+...+\frac{1}{2^{99}}\)
\(\Rightarrow2B-B=\left(2+1+\frac{1}{2}+...+\frac{1}{2^{99}}\right)-\left(1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^{100}}\right)\)
\(\Rightarrow B=2-\frac{1}{2^{100}}\)
\(\Rightarrow A=2\)
Vậy A = 2
Tách 100 thành 100 số 1
Ta có: TS=\(100-\left(1+\frac{1}{2}+\frac{1}{3}+...+\frac{1}{100}\right)=100-1-\frac{1}{2}-\frac{1}{3}-...-\frac{1}{100}=\left(1-1\right)+\left(1-\frac{1}{2}\right)+\left(1-\frac{1}{3}\right)+...+\left(1-\frac{1}{100}\right)\)
=\(0+\frac{1}{2}+\frac{2}{3}+..+\frac{99}{100}=\frac{1}{2}+\frac{2}{3}+..+\frac{99}{100}\)=MS
=> Phân số trên=1
\(\left(\frac{1}{100}+\frac{99}{2}+....+100\right)=\frac{1}{100}+1+\frac{2}{99}+1+....+\frac{99}{2}+1+1\)
đề sai r bạn
Program HOC24;
var i: integer;
s: real;
begin
s:=0;
for i:=1 to 100 do
s:=s+i/100;
write('S=',s:1:2);
readln
end.