-->
当前位置:首页 > 题库

PROGRAMMING:Convert string to decimal integer

Luz5年前 (2021-05-10)题库413
Input a string ending with #, this problem requires filtering out all non hexadecimal characters (regardless of case), forming a new string representing hexadecimal number, and then converting it to decimal number for output. If the character '-' precedes the first hexadecimal character, the number is negative.
###Input format:
Enter a non empty string that ends with # on one line.
###Output format:
Output the converted decimal number on one line. Ensure that the output is in the long integer range.
###Input example:
```in
+-P-xf4+-1!#
```
###Output example:
```out
-3905
```






answer:If there is no answer, please comment