大数取余

 1 import java.util.*;
 2 import java.math.*;
 3 class Main
 4 {
 5     public static void main(String args[])
 6     {
 7         Scanner cin=new Scanner(System.in);
 8         BigInteger a,b;
 9         a=BigInteger.valueOf(1);
10         b=BigInteger.valueOf(1);
11         while(cin.hasNextBigInteger())
12         {
13             a=cin.nextBigInteger();
14             b=cin.nextBigInteger();
15             System.out.println(a.mod(b));
16         }
17     }
18 }

 

posted @ 2012-08-22 13:12  疼痛落在指尖  阅读(135)  评论(0编辑  收藏  举报