Скачиваний:
289
Добавлен:
04.03.2014
Размер:
1.31 Кб
Скачать
program lab1;
uses crt ;
const
v=6;
vv=66;
n=133;
var
c,i,j:byte;
s:integer;
s1:extended;
a,b :array[1..n] of byte;

begin

TextBackground(1);
clrscr;
{1}
Window(5,2,75,7);
TextBackground(2);
clrscr;
highvideo;
textcolor(4);
gotoxy(2,3);
s1:=vv;

for i:=2 to vv do
begin
s1:=s1*vv;
end;
write('66^66=',s1);


{2}
j:=n;
a[j]:=v;
a[j-1]:=v;
a[j-2]:=10;

for i:=2 to vv do
begin

c:=0;
while a[j]<10 do
begin
s:=a[j]*v;

a[j]:=(c+s mod 10) mod 10;
c:=s div 10+(c+s mod 10) div 10;
j:=j-1;
end;
a[j]:=c;
if a[j]<>0 then a[j-1]:=10 else a[j]:=10 ;

c:=0;
j:=n-1;
b:=a;

while b[j]<10 do
begin
a[j]:=(b[j]+c+b[j+1]) mod 10;
c:=(b[j]+c+b[j+1]) div 10;
j:=j-1;
end;

a[j]:=(b[j+1]+c) mod 10;

a[j-1]:=(b[j+1]+c) div 10;

if a[j-1]<>0 then a[j-2]:=10 else a[j-1]:=10; ;
j:=n;
end;


Window(5,10,75,15);
TextBackground(3);
clrscr;
highvideo;
textcolor(5);
gotoxy(2,3);
write('66^66=');

j:=0;
i:=1;
while j<>1 do
begin
if a[i]=10 then j:=1;
i:=i+1;
end;

for j:=i to i+25 do write(a[j]);
write(' E ',n-j);

{3}
Window(5,18,75,23);
TextBackground(4);
clrscr;
highvideo;
textcolor(15);
gotoxy(2,3);
write('66^66=');

for i:=2 to n do
begin
if a[i-1]=10 then j:=1;
if j=1 then write(a[i]);
end;

readkey;
end.
Соседние файлы в папке Alex