注:本系列只为整理、保存比赛模板用,并非代码均为自己所写。会给出原代码的链接。
原链接:http://pepcy.cf/icpc-templates/008Others/javabi.html
一个好用的模板:
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
// read
Scanner in = new Scanner(System.in);
BigInteger a = in.nextBigInteger();
// 3 special numbers
a = BigInteger.ZERO;
a = BigInteger.ONE;
a = BigInteger.TEN;
// convert an int to BigInteger
BigInteger b = BigInteger.valueOf(2333);
BigInteger p = BigInteger.valueOf(998244353);
// convert a BigInteger to int
int i = b.intValue();
// convert a BigInteger to long
long l = b.longValue();
// operations:
// a + b;