题目: |
Program xx2010_3;
var a:array[1..30]of longint;
s,n,i,x,y,z:longint;c:char;
begin
readln(x,y);
readln(z);
n:=0;
while z>0 do begin
n:=n+1;a[n]:=z mod 10;z:=z div 10;
end;
s:=0;
for i:=n downto 1 do s:=s*x+a[i];
writeln(s);
n:=0;
while s>0 do begin
n:=n+1;a[n]:=s mod y;s:=s div y;
end;
for i:=n downto 1 do write(a[i]);
writeln;
end.
【输入】:
7 2
126 输出:69
1000101
|