main.java
来自「java的经典例子」· Java 代码 · 共 16 行
JAVA
16 行
import java.math.*;
class Main {
public static void main(String[] args) {
//
System.out.println(new BigInteger("0", 2).getLowestSetBit()); // -1
System.out.println(new BigInteger("1", 2).getLowestSetBit()); // 0
System.out.println(new BigInteger("1000", 2).getLowestSetBit()); // 3
System.out.println(new BigInteger("-1", 2).getLowestSetBit()); // 0
System.out.println(new BigInteger("-1000", 2).getLowestSetBit()); // 3
System.out.println(new BigInteger("11", 2).getLowestSetBit()); // 0
System.out.println(new BigInteger("-11", 2).getLowestSetBit()); // 0
//
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?