题目: |
var j,n,i,k,res: integer;
a:array[1..100] of integer;
begin
readln(j, n);
fillchar(a,sizeof(a),0);
i:=1;res:=n;
repeat
k:=res mod j;
a[i]:=k;
res:=res div j;
inc(i);
until res=0;
for k:=i-1 downto 1 do write(a[k]);
end.
输入1
3 2
输入2
9 2012 输出:2|2675
|