Poj 1220 Java big data class

Source: Internet
Author: User


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 ");}}}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.