码迷,mamicode.com
首页 > 编程语言 > 详细

Java

时间:2017-10-20 20:23:27      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:class   divide   public   system   大数   java   pre   static   src   

 

Java大数

技术分享
 1 import java.util.*;
 2 import java.math.*;
 3 
 4 public class Main {
 5     public static void main(String args[]) {
 6         int a = 102;
 7         BigInteger x = BigInteger.valueOf(a);
 8         Scanner cin = new Scanner(System.in);
 9         while(cin.hasNext()) {
10             BigInteger y = cin.nextBigInteger();
11             BigInteger z = x.add(y);
12             z = x.multiply(y);
13             z = x.subtract(y);
14             z = x.divide(y);
15             z = x.remainder(y);
16             z = x.mod(y);
17             z = x.pow(4);
18             z = x.gcd(y);
19             z = x.abs();
20             z = x.negate();
21             System.out.println(z.equals(x));
22             String s = new String("101010");
23             BigInteger u = new BigInteger(s, 2);
24             System.out.println(u);
25             z = BigInteger.ZERO;
26             z = BigInteger.ONE;
27             z = BigInteger.TEN;
28         }
29     }
30 }
View Code

 

Java

标签:class   divide   public   system   大数   java   pre   static   src   

原文地址:http://www.cnblogs.com/yijiull/p/7700886.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!