Bài 2:
Program hotrotinhoc_hoc24;
var i,n,d,d1: integer;
begin
write('Nhap n='); readln(n);
i:=0;
while i<n do
begin
i:=i+1;
if i mod 2=1 then d:=d+1;
if i mod 2=0 then d1:=d1+1;
end;
writeln('Co ',d1,' so chan tu 1 den ',n);
write('Co ',d,' so le tu 1 den ',n);
readln
end.
Bài 1:
Program hotrotinhoc_hoc24;
var i,n: integer;
begin
write('Nhap n='); readln(n);
i:=0;
while i<10 do
begin
i:=i+1;
writeln(n,'*',i,'=',n*i);
end;
readln
end.