hdu_2017字符串统计

无节操水三道题,加积分,找成就感。嘿嘿。。。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<cstdio>
int main()
{
int t,n;
char s;
scanf("%d",&t);
getchar();

for(int i = 0;i < t;++i)
{
n = 0;
while((s = getchar())!= '\n')
{
if(s <='9' && s>='0') ++n;
}
printf("%d\n",n);
}
return 0;
}


hdu_2017字符串统计
http://blog.soul11201.com/2013/07/15/oj-hdu-2017/
作者
soul11201
发布于
2013年7月15日
许可协议