题目链接
啥也不说了。和1041一样,简单的大数题。
用C++的话就得开设数组模拟。我直接用JAVA的大数类BigInteger A了代码如下:
import java.util.*; import java.math.*; public class Main { public static void main(String args[]){ Scanner cin = new Scanner(System.in); int N,i; while(cin.hasNext()) { BigInteger a = BigInteger.valueOf(2); BigInteger count = BigInteger.valueOf(1); //用于加1 BigInteger res = BigInteger.valueOf(1); N = cin.nextInt(); for(i=0;i<N-1;i++) { res = res.multiply(a); a= a.add(count); } System.out.println(res); } } }