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

java大数轻松过

时间:2018-05-08 00:49:26      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:col   integer   bsp   sub   code   style   util   div   big   

 1 import java.util.Scanner;
 2 import java.math.BigInteger;
 3 public class Main {
 4     public static void main(String[] args) {
 5         Scanner scan = new Scanner(System.in);
 6         BigInteger a = scan.nextBigInteger();
 7         BigInteger b = scan.nextBigInteger();
 8         System.out.println(a+" + "+b+" = "+a.add(b));
 9         System.out.println(a+" - "+b+" = "+a.subtract(b));
10         System.out.println(a+" * "+b+" = "+a.multiply(b));
11         System.out.println(a+" / "+b+" = "+a.divide(b));                
12     }
13 }

 

java大数轻松过

标签:col   integer   bsp   sub   code   style   util   div   big   

原文地址:https://www.cnblogs.com/acgoto/p/9005954.html

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