Module: (Python) 子例程。递归


Problem

9/12

P数系统中的数字(P<10)

Problem

编写一个递归过程,将数字转换为从29 的任何基数。   

输入
程序的输入是一个自然数 N (N <= 1024) - 10 数系中的一个数和一个数 P ( 2 <= P <= 9)。数字 NP 在同一行中输入,以空格分隔。

印记
在屏幕上打印一个数字 - P-ary 数字系统中的数字。
 
例子
<头> <正文>

# 输入 输出
1 75 6 203
Write the program below
N, P = map(int, input().split())
printNtoP(N, P)     

     

Program check result

To check the solution of the problem, you need to register or log in!