题解 | #小乐乐与进制转换#
小乐乐与进制转换
https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d
#include <stdio.h>
int main() {
long n, arr[10], i = 0, sum = 0;
while (scanf("%ld", &n) != EOF) {
while (n) {
arr[i] = n % 6;
n /= 6;
i++;
}
for (int j = i - 1; j >= 0; j--) {
printf("%ld", arr[j]);
}
}
return 0;
}