Question link: http://poj.org/problem? Id = 1220
Really not used ......
Import Java. math. bigdecimal; import Java. math. biginteger; import Java. util. extends; public class main {/*** @ Param ARGs */public static void main (string [] ARGs) {// todo auto-generated method stub1_input = new partition (system. in); int icase; int B1; int B2; string STR; char ch; int Top = 0; int C; char chh; int TMP; biginteger sum, a; biginteger T; int [] stack = new int [2000]; // the remainder is written into the stack icase = input. nextint (); W Hile (icase --)! = 0) {A = biginteger. valueof (1); sum = new biginteger ("0"); b1 = input. nextint (); b2 = input. nextint (); STR = input. next (); For (INT I = Str. length ()-1; I> = 0; I --) {// convert it to 10 hexadecimal TMP = 0; CH = Str. charat (I); If (CH <= '9' & ch> = '0') {TMP = CH-'0 ';} else if (CH> = 'A' & Ch <= 'Z') {TMP = CH-'A' + 10 ;} else if (CH> = 'A' & Ch <= 'Z') {TMP = CH-'A' + 36;} sum = sum. add (biginteger. valueof (TMP ). mult Iply (a); A =. multiply (biginteger. valueof (B1);} system. out. print (b1 + "" + STR + "\ n" + B2 + ""); biginteger zero = biginteger. valueof (0); // sum! = Biginteger. valueof (0). If this is not the case, you cannot compare whether the two objects are equal. // Shenma is a class ............ Can't stand it, not used to while (sum. compareto (zero )! = 0) {T = sum. moD (biginteger. valueof (B2); stack [++ top] = T. intvalue (); sum = sum. divide (biginteger. valueof (B2);} If (Top = 0) system. out. print (0); While (top! = 0) {c = stack [top --]; If (C <10) chh = (char) (C + '0'); else if (C <36) CHH = (char) (C-10 + 'A'); elsechh = (char) (C-36 + 'A'); system. out. print (CHH);} system. out. print ("\ n ");}}}