← 返回 meta 的题目列表Valid Number
类型:online_judge
Given a string s, determine whether it represents a valid number.
A valid number definition:
It may contain an integer part and/or a fractional part.
It may include an exponent part using e or E; the exponent must be an integer.
A sign +/- is allowed only at the beginning of the string or immediately after e/E.
Leading and trailing spaces are allowed, but spaces are not allowed in the middle.
No other characters are allowed.
Output true or false.
Constraints:
1 <= len(s) <= 10^4
Examples
Input:
0
Output:
true
Input:
e9
Output:
false
Input:
2e10
Output:
true
Input:
-90E3
Output:
true
Input:
1e
Output:
false
Example
Input
0
Output
true