Problem : 2017 ( 字符串统计 ) Judge Status : AcceptedRunId : 6000218 Language : C Author : qq1203456195Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h>
2 int main()
3 {
4 int cnt,i,n;
5 char str[
1000];
6 scanf(
"%d",&
n);
7 while (n--
)
8 {
9 cnt=
0;
10 scanf(
"%s",str);
11 i=
0;
12 while (str[i]!=
'\0')
13 {
14 if(str[i]<=
'9'&&str[i]>=
'0')
15 cnt++
;
16 i++
;
17 }
18 printf(
"%d\n",cnt);
19 }
20 return 0;
21 }
转载于:https://www.cnblogs.com/CheeseZH/archive/2012/05/26/2518778.html
转载请注明原文地址: https://win8.8miu.com/read-1494598.html