下面是我的BigInteger代码,我不知道我哪里出错了,有人能纠正我的代码吗?
import java.math.BigInteger;
import java.util.Scanner;
public class Class2 {
public static void main(String[] args) {
Scanner num = new Scanner(System.in);
System.out.println("Enter BigInteger number : ");
BigInteger nbn = num.nextBigInteger();
for(BigInteger count = BigInteger.ZERO;
count.compareTo(nbn) <= 0;
count.add(BigInteger.ONE)) {
System.out.println(count);
}
}
}发布于 2015-07-22 05:25:56
将count.add(BigInteger.ONE)的值赋值给count
for (BigInteger count = BigInteger.ZERO;
count.compareTo(nbn) <= 0;
count = count.add(BigInteger.ONE)) {
System.out.println(count);
}https://stackoverflow.com/questions/31554402
复制相似问题