如何用JAVA编辑2的N次幂要求N大于64
来源:百度知道 编辑:UC知道 时间:2024/05/21 11:08:15
最好有详细的程序啊!!谢谢了
刚刚弄错了...丫把C++和JAVA混一起了...晕
BigInteger num = new BigInteger("2");
System.out.println(num.shiftLeft(N));
这样才是JAVA......
那个N你要多少就指定多少好了...JAVA这边是用shiftLeft模拟左移运算的...
不能用<<<...
-_-!
for循环,循环N次