首页 > 编程语言 > 详细

Java

时间:2017-10-20 19:18:13      阅读:197      评论:0      收藏:0      [点我收藏+]

 

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!