Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 7 Solved: 1
[Submit][Status][Web Board]
Description
题目描述更简单,直接看输入输出要求即可,数字位数不超过150位
Input
每组测试数组,输入一行两个数,a,b。
Output
每组输出一个数为 a*b的结果
Sample Input
1 3
1000000000000000000 2
1.5 3
0.5 3
3 0.5
Sample Output
3
2000000000000000000
4.5
1.5
1.5
标程:
import java.util.Scanner;
import java.math.*;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner in = new Scanner ( System.in );
BigDecimal num,num2;
while ( in.hasNext() ){
num = in.nextBigDecimal();
num2 = in.nextBigDecimal();
num = num.multiply(num2);
num = num.stripTrailingZeros();
String out = num.toPlainString();
//if ( out.charAt(0) == '0' )
//out = out.substring(1);
System.out.println( out );
}
}
}