Bài 1:
uses crt;
var m,n,i,t:integer;
begin
clrscr;
write('Nhap m='); readln(m);
write('Nhap n='); readln(n);
t:=0;
for i:=m to n do
t:=t+i;
writeln(t);
readln;
end.
2:
uses crt;
var n:integer;
{---------------chuong-trinh-con-kiem-tra-chan-le---------------------}
function ktcl(x:integer):boolean;
begin
if x mod 2=0 then ktcl:=true
else ktcl:=false;
end;
{--------------------chuong-trinh-con-kiem-tra-duong-am-------------------}
fucntion ktda(x:integer):boolean;
begin
if x>0 then ktda:=true
else if x<0 then ktda:=false;
end;
{--------------------chuong-trinh-chinh-------------------------}
begin
clrscr;
write('Nhap n='); readln(n);
if ktcl(n)=true then writeln('Day la so chan')
else writeln('Day la so le');
if ktda(n)=true then writeln('Day la so duong')
else writeln('Day la so am');
readln;
end.