câu A:
uses crt;
var i,n,s: integer;
begin
clrscr;
write ('nhap n: '); readln (n);
for i:=1 to n do s:=s+i;
write ('tong la: ',s);
readln;
end.
Câu B:
uses crt;
var i: integer;
s: real;
begin
clrscr;
for i:=2 to 50 do s:=s+(1/i);
writeln ('tong la: ',s:1:2);
readln;
end.
Câu C:
uses crt;
var i,s: integer;
begin
clrscr;
for i:=1 to 100 do
if i mod 2<>0 then s:=s+i;
writeln ('tong la: ',s);
readln;
end.