Не очень то и получилось)
uses graphabc;
beginsetwindowsize(900,500);line(200,100,700,100);line(200,100,50,250);line(50,250,700,250);line(700,100,700,250);line(200,100,200,250);line(700,200,100,200);circle(150,250,25);circle(350,250,25);circle(500,250,25);circle(650,250,25);end.
program n_1;
uses crt;
var
n: longint;
k: integer;
function Sym(n: integer): char;
begin
case n of
0..9: Sym := chr(48 + n);
10..36: Sym := chr(55 + n);
end;
end;
function funct(n: longint; k: integer): string;
var
st: string;
begin
st := '';
if n = 0 then st := '0' else
begin
while n >= 1 do
begin
st := Sym(n mod k) + st;
n := n div k;
end;
end;
DecToX := st;
end;
begin
readln(n);
repeat
readln(k);
until (2 <= k) and (k <= 36);
writeln(funct(n, k));
end.
// PascalABC.NET 3.3, сборка 1555 от 21.10.2017
// Внимание! Если программа не работает, обновите версию!
uses GraphABC;
begin
Window.SetSize(550,500);
var c:=new GraphABCCoordinate;
c.SetMathematic;
c.OriginY:=500;
Pen.Color:=clBlack;
DrawPolygon(Arr((80,40),(240,280),(200,120)));
DrawPolygon(Arr((320,280),(480,40),(360,120)));
DrawPolygon(Arr((160,120),(240,440),(280,480),(320,440),(400,120)));
DrawPolygon(Arr((280,200),(240,240),(280,280),(320,240)));
DrawPolygon(Arr((280,320),(240,360),(280,400),(320,360)))
end.