int M = in.nextInt();
int N = in.nextInt();
String num = in.next();
BigInteger mScale = new BigInteger(num,M);//以M进制构造BigInteger类型,默认不填M是10进制
System.out.println(mScale.toString(N));//把数转换为N进制。默认不填N是10进制
java中实现进制转换
最新推荐文章于 2024-04-10 20:26:54 发布
491

被折叠的 条评论
为什么被折叠?



