Module: 子程序。递归


Problem

9/12

P 编号系统中的编号 (P < 10)

Problem

编写一个递归过程,将数字转换为 2 到 9 的任意基数。   
输入数据:程序的输入是数NN < 1024)——十进制数和数P >(从 2 到 9)(数字 NP 在不同的行中输入:首先是 N,然后是 P).
输出数据:显示一个数-一个P进制数

示例:
<正文>

输入 印记
75
6
203
1
using System;  
2
class Program  
3
{  
4
    static void convertToPSystem(int n, int p)  
5
    {  
6
7
8
9
10
11
12
13
14
    }  
15
    static void Main()  
16
    {  
17
        int n = Convert.ToInt32(Console.ReadLine());  
18
        int p = Convert.ToInt32(Console.ReadLine());  
19
        convertToPSystem(n, p);  
20
    }  
21
}  

     

Program check result

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