1129:统计数字字符个数

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char st[300];
int main()
{
    int i,s=0;
    gets(st);
    for(i=0;i<=strlen(st);i++)
        if(st[i]>=48&&st[i]<=57)
            s++;
        printf("%d",s);
        return 0;
}
 

猜你喜欢

转载自blog.csdn.net/qq_42552468/article/details/81071682