Uses Crt; Var x,b,z,l,c,r,d,i,u,um:Longint; k:byte; s:string; Begin ClrScr; {------------------------------------------------------} TextColor(white); GotoXY(15,1); WriteLn('Izvlechenia korna kvadratnogo'); WriteLn('Vvedite chislo'); WriteLn(' ÚÄÄÄÄÄÄÄÄ'); Write(' \³'); ReadLn(x); GotoXY(15,4);Write('='); {------------------------------------------------------} for k:=2 to 5 do begin GotoXY(6,3*k);Write('ÄÄÄÄÄÄÄÄÄÄÄ'); end; {------------------------------------------------------} str(x,s); l:=round(length(s)/2)-1; b:=x; z:=1; r:=0; {------------------------------------------------------} while b>=100 do begin b:=b div 100; z:=z*100 end; {------------------------------------------------------} c:=9; while c*c>b do c:=c-1; r:=r*10+c; d:=c*c; x:=x-d*z; {x=3654321} ReadKey; GotoXY(8,5); Write(d); ReadKey; GotoXY(16,4); Write(c); {------------------------------------------------------} l:=l-1; {l=2} z:=z div 100; {z=10000} b:=x; {b=3654321} for i:=1 to l do b:=b div 100; {b=365} ReadKey; GotoXY(8,7); Write(b); c:=9; while (20*r+c)*c>b do c:=c-1; {c=7} r:=r*10+c; {r=27} u:=r*2-c; {u=47} um:=u*c; {um=47*7=329} ReadKey; GotoXY(3,7); Write(u); ReadKey; GotoXY(4,8); Write(c); ReadKey; GotoXY(8,8); Write(um); ReadKey; GotoXY(17,4); Write(c); {------------------------------------------------------} l:=l-1; {l=1} b:=x; {b=3654321} b:=b-um*z; {b=364321} z:=z div 100; {z=100} for i:=1 to l do b:=b div 100; ReadKey; GotoXY(9,10); Write(b); {b=3643} c:=9; while (20*r+c)*c>b do c:=c-1; r:=r*10+c; u:=r*2-c; um:=u*c; ReadKey; GotoXY(3,10); Write(u); ReadKey; GotoXY(5,11); Write(c); ReadKey; GotoXY(9,11); Write(um); {3276} ReadKey; GotoXY(18,4); Write(c); {------------------------------------------------------} l:=l-1; {l=0} b:=b*z+x mod 100; b:=b-um*z; z:= z div 100; for i:=1 to l do b:=b div 100; ReadKey; GotoXY(10,13); Write(b); c:=9; while (20*r+c)*c>b do c:=c-1; r:=r*10+c; u:=r*2-c; um:=u*c; ReadKey; GotoXY(3,13); Write(u); ReadKey; GotoXY(6,14); Write(c); ReadKey; GotoXY(10,14); Write(um); ReadKey; GotoXY(19,4); Write(c); {------------------------------------------------------} b:=b-um; ReadKey; GotoXY(11,16); Write(b); ReadLn; End.