SDUT2525:A-B (模板题)
import java.util.Scanner; import java.math.*; public class Main { public static void main(String[] args) { Scanner ci = new Scanner(System.in); BigInteger a; BigInteger b; while(ci.hasNext()) { a=ci.nextBigInteger(); b=ci.nextBigInteger(); System.out.println(a.subtract(b)); } ci.close(); } }
SDUT3134:大数取模
import java.util.Scanner; import java.math.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(cin.hasNext()) { BigInteger a,b; a=cin.nextBigInteger(); b=cin.nextBigInteger(); System.out.println(a.mod(b)); } cin.close(); } }