2013省赛----梅森素数(考察大数运算:BigInteger)

    科技2022-08-04  109

    import java.math.BigInteger; public class TestOne { public static void main(String[] args) { BigInteger x = BigInteger.valueOf(2).pow(11213).subtract(BigInteger.ONE); String s = x.toString(); int len = s.length(); System.out.println(s.substring(len-100).length());//截取子串的长度为100 System.out.println(s.substring(len-100)); } }

     

    Processed: 0.009, SQL: 8