答案是一个长度为100的数字串,请通过浏览器直接提交该数字。 注意:不要提交解答过程,或其它辅助说明类的内容。
方法一import java.math.BigInteger;public void func1() { BigInteger messon = new BigInteger("1"); BigInteger two = new BigInteger("2"); for(int i=0;i<11213;++i) { messon = messon.multiply(two); } String tmp = messon.subtract(BigInteger.ONE).toString(); System.out.PRintln(tmp.substring((tmp.length()-100)));}方法二 public void func2() { int[] pos = new int[100]; pos[0] = 1; int r = 0, j =0; for(int p=0;p<11213;++p) { for(int q=0;q<100;++q) { int tmp = pos[q] * 2;//每一位乘以2 r = tmp%10;//获取余数 pos[q] = r + j;//加上之前的进位 j = tmp/10;//获取进位 } //一遍之后,进位需要清零 j = 0; } for(int q=99;q>0;--q) { System.out.print(pos[q]); } //2的阶乘的位数一定不为0,可放心的减1 System.out.println(pos[0] - 1); }输出Compiling Messon.java.......-----------OUTPUT-----------func18586718527586602439602335283513944980064327030278104224144971883680541689784796267391476087696392191func28586718527586602439602335283513944980064327030278104224144971883680541689784796267391476087696392191[Finished in 3.3s]下面的两种方法均为Java语言
新闻热点
疑难解答