class Solution {
public:
bool isNum(char *ch)
{
if(*ch<='9'&&*ch>='0')
return true;
else return false;
}
bool isNumeric(char* string)
{
if(string==NULL)
return false;
if(*string=='+'||*string=='-')
string++;
if(*string=='\0')
return false;
while(*string!='\0')
{
if(*string=='.'||*string=='e'||*string=='E')
break;
else if(isNum(string))
string++;
else return false;
}
if(*string=='.')
{
string++;
while(*string!='\0')
{
if(isNum(string))
string++;
else if(*string=='e'||*string=='E')
break;
else return false;
}
}
if(*string=='e'||*string=='E')
{
string++;
if(*string=='\0')
return false;
if(*string=='+'||*string=='-')
string++;
if(*string=='\0')
return false;
while(*string!='\0')
{
if(isNum(string))
string++;
else return false;
}
}
return true;
}
};