C语言 判断一个字符串是否全为数字

#include
#include
int main()
{
    char a[]="1000023233d";
    if(strspn(a, "0123456789")==strlen(a))
    {
        printf("quan wei shu zi\n");
    }else{
        printf("bu quan wei shu zi\n");
    }
    return 0;
}

转自:https://blog.csdn.net/mantis_1984/article/details/52212088

完!!

你可能感兴趣的:(C语言拾遗)