Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one.
再加几个测试用例:
"1." => true
".3" => true
"." => false
"1e+10" =>true
"1e0.6" =>false
"1e" => false
"e1" => false
"e" => false
" 1 " => true
1 class Solution { 2 public: 3 bool isNumber(const char *s) { 4 while (*s != '