Description
Calculate A-B
Input
Two decimal integers a and b(-10^100 < a,b < 10^100) in one line, separated by one space.
Output
Output a-b in one line.
Sample Input
1 2
Sample Output
-1
Calculate A-B
Input
Two decimal integers a and b(-10^100 < a,b < 10^100) in one line, separated by one space.
Output
Output a-b in one line.
Sample Input
1 2
Sample Output
-1
package OJ;
import java.math.BigInteger;
import java.util.*;
public class P2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
BigInteger i1 = in.nextBigInteger(); //10^100需要使用大整型
BigInteger i2 = in.nextBigInteger();
BigInteger sum = i1.subtract(i2);
System.out.println(sum);
}
}