A-B Problem
Accept:828 | Submit:7190 |
Time Limit:1000MS | Memory Limit:65536KB |
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
Source
BUPT Online Judge
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
Source
BUPT Online Judge
CODE:
import java.math.BigInteger;
import java.util.Scanner;
public class Main{
public static void main(String args[]) {
Scanner cin=new Scanner(System.in);
BigInteger a,b;
a=cin.nextBigInteger();
b=cin.nextBigInteger();
a=a.subtract(b);
System.out.println(a.toString());
}
}