Bài 1:
uses crt;
var n,t1,t2,t3,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t1:=0;
t2:=0;
for i:=1 to n-1 do
begin
if i mod 2=1 then t1:=t1+i
else t2:=t2+i;
end;
writeln('Tong cac so le nho hon ',n,' la: ',t1);
writeln('Tong cac so chan nho hon ',n,' la: ',t2);
t3:=0;
for i:=1 to 2*n do
t3:=t3+i;
writeln('Tong cac so trong day so tu 1 toi 2*',n,' la: ',t3);
readln;
end.