Page 107 - C:\Users\Admin\Desktop\Sach mem upweb\
P. 107
100 Problems & Solutions Trang 107
begin
a[k,a2]:=i;
gotoxy(5*(a2),k);
inc(mau);
if mau>15 then
mau:=1;
textcolor(mau);
write(i);
delay(70);
inc(i);
end;
for k:=b2+t downto b1+1 do
begin
a[k,b2]:=i;
gotoxy(5*(b2-1),k);
inc(mau);
if mau>15 then mau:=1;
textcolor(mau);
write(i);
delay(70);
inc(i);
end;
for k:=a2-2 downto a1 do
begin
a[b1+1,k]:=i;
gotoxy(5*k,b1+1);
inc(mau);
textcolor(mau);
write(i);
delay(70);
inc(i);
end;
dec(a2,2);
dec(b2,2);
inc(t,2);
inc(b1,2);
end;
if n>2 then s:=3*(n-2) else s:=1;
writeln;writeln;
writeln('Bang dong ho max');writeln;
writeln('Voi ma tran vuong cap ',n,'thi so luong tu giac dong ho lon nhat la:',s);
readln;
End;
{------------------}
procedure min;
begin
clrscr;
writeln('n>=2:');readln(n);
i:=1;
b1:=1;
Tin học & Nhà trường 100 Đề Toán - Tin học