請實現一個函數用來判斷字符串是否表示數值(包括整數和小數)。例如,字符串"+100","5e2","-123","3.1416"和"-1E-16"都表示數值。 可是"12e","1a3.14","1.

using namespace std; class Solution { public: bool scanUnsignedInteger(char** str){ const char* before = *str; while(**str!='\0' && **str >= '0' && **str <= '9') ++(*str); //當str中存在若干0-9的數字時,返回true re
相關文章
相關標籤/搜索