for (int i = 0; i < max.length; i++) {
BigInteger a = new BigInteger(max1 + i + 1 + “”);
max[i] = a.multiply(a);
}
System.out.println("The ten squares max value are: ");
for (int i = 0; i < max.length; i++) {
System.out.println(max[i]);
}
}
}
==================================================================
这个代码应该没错,但是运行时间太长了,没等到结果。。。。。。
import java.math.BigInteger;
public class dishizhang {
public static void main(String[] args) {
// TODO Auto-generated method stub
int count = 0;
BigInteger n = new BigInteger(Long.MAX_VALUE + “”);
while (count < 5) {
if (isPrime(n)) {
System.out.print(n + " ");
count++;
}
n = n.add(BigInteger.ONE);
}
}
public static boolean isPrime(BigInteger i) {
for (BigIn