tham khảo
Program bt_3;
Uses crt;
Var Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap n=’);
Readln (n);
Tong:=0;
For i:=1 to n do
If I mod 2 = 1 then Tong:= Tong+i;
Writeln(‘Tong la:’,Tong);
Readln
End.
uses crt;
var n,m,i,t:integer;
begin
clrscr;
readln(n,m);
t:=0;
for i:=n to m do t:=t+i;
writeln(t);
readln;
end.