Big Integer Operation
1 /***//********************************* *************************************
2 * @ problem: Big Integer Operation
3 * @ goal:
4 * @ Author: Welfare
5 * @ version: 1.0
6 *************************************** ******************************/
7 Import java. Io .*;
8 Import java. util .*;
9 Import java. Math. biginteger;
10
11 public class main
12 {
13 public static void main (string ARGs []) throws exception
14 {
15 bufferedreader stdin =
16 new bufferedreader (
17 new inputstreamreader (system. In ));
18
19 (;;)
20 {
21 string line = stdin. Readline ();
22 if (line = NULL) break;
23
24 stringtokenizer ST = new stringtokenizer (line );
25 biginteger A = new biginteger (St. nexttoken ());
26 biginteger B = new biginteger (St. nexttoken ());
27
28 system. Out. println (A. Multiply (B); // use divide (), add (), subtract ()
29}
30}
31}
It is indeed much more convenient than C/C ++. In the biginteger class, there areBitwise operationSuch as or, exclusive or, non, left shift, right shift, etc.