标签:
import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); BigInteger a,b; String[] s; while(in.hasNextLine()){ s = in.nextLine().split("\\s+"); //正则表达式,\\s+ 表示一个或多个空白字符 a = new BigInteger(s[0]); b = new BigInteger(s[2]); if(s[1].equals("%")) System.out.println(a.mod(b)); if(s[1].equals("/")) System.out.println(a.divide(b)); } } }
uva 10494 If We Were a Child Again
标签:
原文地址:http://www.cnblogs.com/yong-hua/p/4655821.html