标签:des style color java os io for ar div
Description
Input
Output
Sample Input
2 1100 101 10 123456789123456789123456789 1000 0
Sample Output
10 789
求p%m的b进制表示。果断java。
import java.io.*; import java.math.*; import java.util.*; public class Main { public static void main(String[] arges){ Scanner cin = new Scanner (System.in); int b; BigInteger p,m,ans; while(cin.hasNext()) { b=cin.nextInt(); String str; if(b==0) break; p=cin.nextBigInteger(b); m=cin.nextBigInteger(b); ans=p.mod(m); str=ans.toString(b); System.out.println(str); } } }
POJ 2305 Basic remains(JAVA练习)
标签:des style color java os io for ar div
原文地址:http://blog.csdn.net/u013582254/article/details/38824245