check whether the string is numerical
int isNumber(char s[]) { for (int i = 0; s[i]!= '\0'; i++) { if(i==0 ){ if(s[i]!= '-' && isdigit(s[i]) == 0) // 不是负数,也不是数字 return 0; } else if (isdigit(s[i]) == 0) return 0; } return 1; }