30. 数字字符个数

单点时限: 1.0 sec

内存限制: 256 MB

定义函数 Digits,计算一个字符串中数字字符的个数。

//********** Specification of Digits **********
int Digits(char *s);
/* PreCondition: s指向一个长度范围为 1 – 80 的由英文、数字组成的字符串
    PostCondition: 返回s所指字符串中数字字符 '0'—'9' 的个数
*/

只需按要求写出函数定义,并使用给定的测试程序测试你所定义函数的正确性。
不要改动测试程序。测试正确后,将测试程序和函数定义一起提交。

#include <stdio.h>

//********** Specification of Digits **********
int Digits(char *s) {

}

/***************************************************************/
int main() {
    char s[81];
    scanf("%s", s);
    printf("%d\n", Digits(s));
    return 0;
}

样例

Input
ecnu2018
Output
4

407 人解决,427 人已尝试。

466 份提交通过,共有 972 份提交。

1.2 EMB 奖励。

创建: 6 年,3 月前.

修改: 6 年,3 月前.

最后提交: 6 天前.

来源: 2017 程序设计基础期末考

题目标签