Module: (Python) 서브루틴. 재귀


Problem

9/12

P 수 체계의 수(P<10)

Problem

숫자를 2에서 9까지 임의의 밑으로 변환하는 재귀 절차를 작성하세요.   

입력
프로그램에 대한 입력은 자연수 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!