进制转换 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 23830 Accepted Submission(s): 13344 Problem Description 输入一个十进制数N,将它转换成R进制数输出. Input 输入数据包括多个測试实例,每一个測试实例包括两个整数N(32位整数)和R(2<=R<=16, R&…
题意是将十进制数转换成二进制数. 从网上找到的十进制转 k 进制的做法,代码如下: #include <bits/stdc++.h> using namespace std; ','A','B','C','D','E','F'}; void conv(int n,int k)//k 为进制 { int r; r = n%k; n = n/k; if(n) conv(n,k); printf("%c",a[r]); } int main() { int n,k; while(…