0
点赞
收藏
分享

微信扫一扫

2012填空——棋盘放麦子 java

查拉图斯特拉你和他 2022-03-22 阅读 25

在这里插入图片描述

分析

大数处理
参考:https://blog.csdn.net/GD_ONE/article/details/103951501

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger ans = new BigInteger("1");
		BigInteger bb = new BigInteger("1");
		for (int i = 2; i <= 64; i++) {
			bb = bb.multiply(new BigInteger("2"));
			ans = ans.add(bb);
		}
		System.out.println(ans);
	}
}
举报

相关推荐

0 条评论