#P417. 【例72.2】 取出整数的一部分
【例72.2】 取出整数的一部分
Description
Given an integer, we can perform a truncation operation on it.
If is positive, we take the first digits from left to right. For example, if the input is , we return the first digits, which is ;
If is negative, we take the last digits from right to left. For example, if the input is , we return the last digits, which is ;
If the input is , we return the original number, which is ;
If the absolute value of the input number is greater than the number of digits in the given number (e.g., or ), we return "".
Please implement this operation.
Input Format
The first line contains a positive integer ().
The second line contains an integer ().
Output Format
Output a single line containing either an integer or "". If the returned number contains leading zeros, they should be removed.
Sample
33010
-310