高精度乘法问题,WA了两次是因为没有考虑结果为0的情况. 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…
虽然是错的代码,但是还是想贴出来,最开始WA发现是没有考虑到乘积为0的情况,后来把a*0,0*a,a*0---0(若干个0),0--0(若干个0)*a都考虑进去了:可是还是WA,实在不懂先留在这儿. 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…
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 c…
Product of digits For a given non-negative integer number N , find the minimal natural Q such that the product of all digits of Q is equal N . Input The first line of input contains one positive integer number, which is the number of data sets. Ea…
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…
尝试一下java 的大数类 import java.util.*; import java.io.*; import java.math.BigInteger; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNextBigInteger()) { BigInteger a = in.nextBigInteger(), b =…