使用扫描仪从控制台读取BigInteger
import java.util.Scanner; import java.math.BigInteger; /** 来 自 时代Java公众号 - nowjava.com **/ public class BigIntegerInputOutput { public static void main(String cLA[]) { Scanner myInput = new Scanner(System.in); BigInteger aBigNumber = myInput.nextBigInteger(); System.out.printf("%d\n", aBigNumber); } }