【面试题目】-C++中判断字符串是否全部由数字组成

 bool isAllDigit(const string& str)
{
    int i ;
    for(i = 0; i != str.length(); i++)
    {
        if(!isdigit(str[i]))
        {
            return false;
        }
    }
    return true;
}

posted on 2009-10-20 19:22  醉清风JM  阅读(578)  评论(0)    收藏  举报

导航