Hexadecimal sayı dahil
Uses Crt;
Label A1;
Var x,y,v:Longint;
z,i,k:Longint;
A,C,F:Array[-2..200] of Longint;
Begin
ClrScr;
Write('D”n�Ÿt�r�lecek Say�y� Giriniz: ');Readln(x);
Write('D”n�Ÿt�r�lecek Taban: ');Readln(y);
z:=y;
A1:
a[k]:=z;
z:=z*y;
k:=k+1;
if z<=x then goto A1;
f[k-1]:=x;
For i:=(k-1) downto 0 do
Begin
C[i]:=F[i] div A[i];
F[i-1]:=F[i] mod A[i];
End;
v:=f[i-1] div 1;
For i:=(k-1) downto 0 do
Begin
if c[i]=10 Then Write('A')
Else if c[i]=11 Then Write('B')
Else if c[i]=12 Then Write('C')
Else if c[i]=13 Then Write('D')
Else if c[i]=14 Then Write('E')
Else if c[i]=15 Then Write('F')
Else Write(c[i]);
End;
Write(v);
Readln
End.