高精度.
水题.只要注意例如00000001 + 0000003的时候的输出也要含有前导零.
import java.io.*;
import java.util.*;
import java.math.*;
import java.text.*;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner (new BufferedInputStream(System.in));
BigInteger max = BigInteger.valueOf(2147483647);
String a1;
String b1;
BigInteger a;
BigInteger b;
BigInteger sum = BigInteger.valueOf(0);
String c;
while (cin.hasNext())
{
a1 = cin.next();
c = cin.next();
b1 = cin.next();
a = new BigInteger(a1);
b = new BigInteger(b1);
System.out.println(a1 + ' ' + c + ' ' + b1);
if (c.equals("+"))
sum = b.add(a);
if (c.equals("*"))
sum = b.multiply(a);
if (a.compareTo(max) > 0)
System.out.println("first number too big");
if (b.compareTo(max) > 0)
System.out.println("second number too big");
if (sum.compareTo(max) > 0)
System.out.println("result too big");
}
}
}