← 返回 google 的题目列表Subtract Two Numeric Strings (Big Integer Subtraction)
类型:online_judge
Problem: Subtract Two Numeric Strings (Big Integer Subtraction)
Given two strings a and b representing non-negative decimal integers (may contain leading zeros), compute a - b and output the result as a string.
Rules
If the result is negative, prefix it with -.
The output must not contain leading zeros (except that zero is represented as 0).
Input (stdin)
Two lines:
a
b
Output (stdout)
One line:
a-b
Constraints
1 <= len(a), len(b) <= 1e5
a and b consist only of digits 0-9
Example
Input:
1000
1
Output:
999
Example
Input
1000
1
Output
999