poj 2305 Basic remains java

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


public class Main {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner cin= new Scanner(System.in);
        int b=0;
        while(cin.hasNextInt())
        {
            b=cin.nextInt();
            if(b==0) break;

            BigInteger p=cin.nextBigInteger(b);
            BigInteger m=cin.nextBigInteger(b);

            BigInteger ans=p.mod(m);
            String st=ans.toString(b);
            System.out.println(st);
        }
    }
}

你可能感兴趣的:(poj 2305 Basic remains java)