(高精度运算4.7.27)UVA 10494 If We Were a Child Again(大数除法&&大数取余)

package com.njupt.acm;

import java.math.BigInteger;
import java.util.Scanner;

public class UVA_10494 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNext()){
			BigInteger a = scanner.nextBigInteger();
			String str = scanner.next();
			BigInteger b = scanner.nextBigInteger();
			
			if(str.equals("/")){
				System.out.println(a.divide(b));
			}else if(str.equals("%")){
				System.out.println(a.mod(b));
			}
		}
	}
}



posted @ 2013-10-30 21:30  pangbangb  阅读(139)  评论(0编辑  收藏  举报