JAVA 练习
大整数取模,直接利用大整数的 .remainder ( mod ) 就行了
// package program;
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
BigInteger ans = in.nextBigInteger();
BigInteger mod = in.nextBigInteger();
System.out.println(ans.remainder(mod));
}
}
}