zoukankan      html  css  js  c++  java
  • UVA10106 Product(大数相乘)(Java题解)

    Product

    The Problem
    The problem is to multiply two integers X, Y. (0<=X,Y<10250)

    The Input
    The input will consist of a set of pairs of lines. Each line in pair contains one multiplyer.

    The Output
    For each input pair of lines the output line should consist one integer the product.

    Sample Input
    12
    12
    2
    222222222222222222222222
    Sample Output
    144
    444444444444444444444444

    代码如下:

    import java.math.BigInteger;
    import java.util.Scanner;
    public class Main{
     public static void main(String[] args){
     Scanner s=new Scanner(System.in);
     while(s.hasNext()){
     BigInteger a=s.nextBigInteger();
     BigInteger b=s.nextBigInteger();
     BigInteger c=a.multiply(b);
     System.out.println(c);
      }
     }
    }
    天晴了,起飞吧
  • 相关阅读:
    Java多线程
    SpringCloud
    Java 多线程
    MySQL
    MySQL
    SpringCloud
    SpringCloud
    SpringCloud
    SpringBoot
    Spring MVC
  • 原文地址:https://www.cnblogs.com/jianqiao123/p/11202428.html
Copyright © 2011-2022 走看看