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.
while..do
Program HOC24;
uses crt;
var i,n: integer;
S: longint;
begin
clrscr;
write('Nhap N: '); readln(n);
i:=0; s:=0;
while i<n do
begin
i:=i+1;
s:=s+i*(i+1);
end;
write('S=',S);
readln
end.
uses crt;
var s,i,n:longint;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+i*(i+1);
writeln(s);
readln;
end.
câu2
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.Lời giải :
program hotrotinhoc ;
var S,n,i : integer ;
begin
write('Nhap n='); readln(n);
for i:= 1 to n do S:=S+i*(i+1) ;
write('S=',S);
readln
end.
Var n,S,i:longint;
Begin
write('nhap n:'); readln(n);
S:=0;
For i:=1 to n do S:=S+n*(n+1);
writeln(S);
Readln
End.
program TinhTong;
uses crt;
var
N, i, j, tich: integer;
S: real;
begin
clrscr;
write('Nhap so nguyen N: ');
readln(N);
S := 0;
tich := 1;
for i := 1 to N do
begin
tich := tich * i;
S := S + tich;
end;
writeln('Tong S = ', S:0:2);
readln;
end.
program Tinh_tong;
uses crt;
var S, i: longint;
begin
clrscr;
S:= 0;
i:=1;
For i:=1 to 99 do S:= S + 1/[i*(i+1)];
writeln('Tong cua S=', S);
Readln
End.
program Tinh_tong;
uses crt;
var S,i,n:longint;
begin
clrscr;
writeln('hay nhap n',); Readln(n);
S:=0;
i:=1;
For i:=\(\frac{1}{1.3}\)to\(\frac{1}{99.100}\) do \(S:=S+\frac{1}{99.100}\);
i:=i+1;
IF i<=n THEN writeln('Tong cua S=',A);
Readln
End.
Câu 6:
uses crt;
var n,i:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
if n mod i=0 then write(i:4);
readln;
end.
5:
uses crt;
var n,i,dem:integer;
begin
clrscr;
readln(n);
dem:=0;
for i:=0 to n do
if i mod 2=1 then
begin
write(i:4);
dem:=dem+1;
end;
writeln;
writeln(dem);
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.