且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HDOJ2017 ( 字符串统计 )

更新时间:2022-09-07 16:10:41

Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
HDOJ2017 ( 字符串统计 )
 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 }
HDOJ2017 ( 字符串统计 )

 

本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/archive/2012/05/26/2518778.html,如需转载请自行联系原作者