*B=2+4+6+...+2020
uses crt;
var b:real;
i:integer;
begin
clrscr;
b:=0;
i:=0;
while i<=2020 do
begin
i:=i+2;
b:=b+i;
end;
writeln(b:0:0);
readln;
end.
*C=1/3+1/6+1/9+...+1/3n
uses crt;
var c:real;
i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
c:=0;
i:=1;
while i<=n do
begin
c:=c+1/(3*i);
i:=i+1;
end;
writeln(c:4:2);
readln;
end.
*Tổng các số lẻ trong phạm vi 2021
uses crt;
var d:real;
i:integer;
begin
clrscr;
d:=0;
i:=1;
while i<=2021 do
begin
d:=d+i;
i:=i+2;
end;
writeln(d:0:0);
readln;
end.