题解 | #小乐乐与进制转换#
小乐乐与进制转换
https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d
#include <stdio.h> int main() { long n=0,sum=0,t=1; scanf("%d",&n); while(n>0) { sum=sum+n%6*t; n/=6; t*=10; } printf("%ld",sum); return 0; }
小乐乐与进制转换
https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d
#include <stdio.h> int main() { long n=0,sum=0,t=1; scanf("%d",&n); while(n>0) { sum=sum+n%6*t; n/=6; t*=10; } printf("%ld",sum); return 0; }
相关推荐