java实现大数取模

2019-04-13 21:20发布

import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub BigInteger a,b; Scanner cin = new Scanner(System.in); while(cin.hasNext()){ a = cin.nextBigInteger(); b = cin.nextBigInteger(); BigInteger result=a.mod(b); System.out.println(result); } } }