procedure push(var ar:ty); var i,c:integer; begin c:=ar[n]; for i:=n downto 2 do ar[i]:=ar[i-1]; ar[1]:=c; end;
begin randomize; writeln('Enter K:'); readln(k); writeln('First array:'); for i:=1 to n do begin; ar[i]:=random(10); write(ar[i]:4); end; for i:=1 to k do push(ar); writeln; writeln('Final array:'); for i:=1 to n do write(ar[i]:4); end. 2)var a,i,b,r,n:integer; s,se:string;
procedure preob(var a,b,n:integer; var se:string); begin repeat b:=a mod n; a:=a div n; str(b,se); s+=se; until (a<=n-1); end;
begin readln(a); readln(n); preob(a,b,n,se); str(a,se); s+=se; for i:=1 to length(s) div 2 do begin; se:=s[i]; s[i]:=s[length(s)-i+1]; s[length(s)-i+1]:=se[1]; end; val(s,r,a); write(r); end.
Const
n=10;
type
ty=array[1..n] of integer;
var
ar:ty;
i,k:integer;
procedure push(var ar:ty);
var
i,c:integer;
begin
c:=ar[n];
for i:=n downto 2 do
ar[i]:=ar[i-1];
ar[1]:=c;
end;
begin
randomize;
writeln('Enter K:');
readln(k);
writeln('First array:');
for i:=1 to n do
begin;
ar[i]:=random(10);
write(ar[i]:4);
end;
for i:=1 to k do
push(ar);
writeln;
writeln('Final array:');
for i:=1 to n do
write(ar[i]:4);
end.
2)var
a,i,b,r,n:integer;
s,se:string;
procedure preob(var a,b,n:integer; var se:string);
begin
repeat
b:=a mod n;
a:=a div n;
str(b,se);
s+=se;
until (a<=n-1);
end;
begin
readln(a);
readln(n);
preob(a,b,n,se);
str(a,se);
s+=se;
for i:=1 to length(s) div 2 do
begin;
se:=s[i];
s[i]:=s[length(s)-i+1];
s[length(s)-i+1]:=se[1];
end;
val(s,r,a);
write(r);
end.
GraphABC;
begin
SetPenColor(ClGreen);
Line(100,100,120,140);
Line(100,100,80,140);
Line(80,140,120,140);
Line(100,140,70,190);
Line(100,140,130,190);
Line(70,190,130,190);
Line(100,190,50,250);
Line(100,190,150,250);
Line(50,250,150,250);
FloodFill(100,160,clGreen);
FloodFill(100,130,clGreen);
FloodFill(100,200,clGreen);
Line(300,100,320,140);
Line(300,100,280,140);
Line(280,140,320,140);
Line(300,140,270,190);
Line(300,140,330,190);
Line(270,190,330,190);
Line(300,190,250,250);
Line(300,190,350,250);
Line(250,250,350,250);
FloodFill(300,160,clGreen);
FloodFill(300,130,clGreen);
FloodFill(300,200,clGreen);
Line(500,100,520,140);
Line(500,100,480,140);
Line(480,140,520,140);
Line(500,140,470,190);
Line(500,140,530,190);
Line(470,190,530,190);
Line(500,190,450,250);
Line(500,190,550,250);
Line(450,250,550,250);
FloodFill(500,160,clGreen);
FloodFill(500,130,clGreen);
FloodFill(500,200,clGreen);
end.