import java.io.*;
import java.math.*;
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner cin = new Scanner(new BufferedInputStream(System.in));
int n;
while(cin.hasNext()){
n = cin.nextInt();
BigInteger a[] = new BigInteger [20];
BigInteger two = new BigInteger("2");
a[1] = two;
int i;
System.out.println(2);
BigInteger tmp = new BigInteger("1");
BigInteger one = new BigInteger("1");
for(i=2;i<=n;i++){
tmp = tmp.multiply(a[i-1]);
a[i] = tmp.add(one);
System.out.println(a[i]);
}
}
}
}
【Java练习3】POJ 1405
最新推荐文章于 2021-02-28 22:16:41 发布