题解 | #小乐乐与进制转换#
小乐乐与进制转换
https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d
void switch_num(int n) { if (n > 0) { switch_num(n/6); printf("%d",n%6); } } int main() { int n = 0; scanf("%d", &n); switch_num(n); return 0; }
小乐乐与进制转换
https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d
void switch_num(int n) { if (n > 0) { switch_num(n/6); printf("%d",n%6); } } int main() { int n = 0; scanf("%d", &n); switch_num(n); return 0; }
相关推荐