2017 字符串统计
来源:互联网 发布:mac玩美服lol加速器 编辑:程序博客网 时间:2024/05/10 12:24
字符串统计
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 40021 Accepted Submission(s): 22269
Problem Description
对于给定的一个字符串,统计其中数字字符出现的次数。
Input
输入数据有多行,第一行是一个整数n,表示测试实例的个数,后面跟着n行,每行包括一个由字母和数字组成的字符串。
Output
对于每个测试实例,输出该串中数值的个数,每个输出占一行。
Sample Input
2asdfasdf123123asdfasdfasdf111111111asdfasdfasdf
Sample Output
69
#include<stdio.h>#include<string.h>void main(){ int n,i,j,x; char str[500]; scanf("%d",&n); for(j=0;j<n;j++) { x=0; scanf("%s",str); for(i=0;i<strlen(str);i++) { if(str[i]>='0'&&str[i]<='9') x++; } printf("%d\n",x); }}
0 0
- hdoj-2017 字符串统计【字符串】
- hdu 2017 字符串统计
- 2017 字符串统计
- HDU 2017 字符串统计
- 2017:字符串统计
- HDU 2017 字符串统计
- 字符串统计 hdu 2017
- 【 2017 字符串统计】
- hdu-2017-字符串统计
- HDU 2017 - 字符串统计
- 字符串统计(2017)
- HDU 2017 字符串统计
- [hdu 2017] 字符串统计
- 2017 字符串统计
- HDUJ 2017 字符串统计
- HDU 2017 字符串统计
- 字符串统计(2017)
- HDU 2017 字符串统计
- 3D SLicer中图像分割与配准的具体思路
- warning: directory not found for option ' '
- 计算机网络(三)
- 枚举算法
- rsyslog的relp转发及自定义端口号问题
- 2017 字符串统计
- 《python源码剖析》笔记 pythonm内存管理机制
- python对xml文件操作小例程
- error:the kernel you are installing for is a xen kernel!
- maven 转载
- android 异步处理采用Thread + Handler + Message
- 2018 母牛的故事
- Linux -- Crond 定时任务
- Play 标准的应用目录布局