题目:
【问题描述】
7 月 1 日是建党日,从 1921 年到 2020 年, 已经带领中国人民
走过了 99 年。
请计算:7 ^ 2020 mod 1921,其中 A mod B 表示 A 除以 B 的余数。
【答案提交】
这是一道结果填空题,你只需要算出结果后提交即可。本题的结果为一个
整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
分析:
这道题考的是biginterger中.pow立方和.remainder取余的用法
步骤:
package 第十一届省赛;
import java.math.BigInteger;
public class 指数运算 {
public static void main(String[] args) {
BigInteger x = new BigInteger("7");
BigInteger y = new BigInteger("1921");
BigInteger z = x.pow(2020).remainder(y);
System.out.println(z);
}
}