Record-2-4
2015-07-21 20:40
197 查看
HPU-2014-暑假训练-1
#include <stdio.h>
#include <string.h>
int main ()
{
int n,l,i,cnt;
char a[100];
scanf("%d",&n);
while (n--){
cnt=0;
scanf("%s",a);
getchar();
l = strlen (a);
//printf("%d",l);
for (i=0;i<l;i++){
if(a[i]>='0'&&a[i]<='9'){
cnt++;
}
}
printf("%d\n",cnt);
}
return 0;
}
/*
ASCII码的范围是确定的:一组数据中的字符都有其字符所对应的唯一的ASCII码;
‘’这个符号能求出字符所对应的ASCII码的值
*/
#include <stdio.h>
#include <string.h>
int main ()
{
int n,l,i,cnt;
char a[100];
scanf("%d",&n);
while (n--){
cnt=0;
scanf("%s",a);
getchar();
l = strlen (a);
//printf("%d",l);
for (i=0;i<l;i++){
if(a[i]>='0'&&a[i]<='9'){
cnt++;
}
}
printf("%d\n",cnt);
}
return 0;
}
/*
ASCII码的范围是确定的:一组数据中的字符都有其字符所对应的唯一的ASCII码;
‘’这个符号能求出字符所对应的ASCII码的值
*/
相关文章推荐
- 今年暑假不AC
- 关于java基础--排序方法
- [CareerCup] 2.6 Linked List Cycle 单链表中的环
- PHPCMS \phpcms\modules\member\index.php 用户登陆SQL注入漏洞分析
- 逻辑回归模型分析
- 什么是线程,线程与进程有什么区别?
- CoreDataDemo
- swift2 自动引用计数
- 大图轮播
- Node.js的线程和进程
- [DLX重复覆盖] hdu 3957 Street Fighter
- POJ 1185 炮兵阵地(状态压缩dp)
- SQL server 2008数据库的备份与还原
- Spring Quartz集群(二)
- 为什么你只是个码农
- vs2012连接sql2008(错误类型:Could not load file or assembly)
- 判断链表 有环
- 梅尔频率倒谱系数(MFCC)的提取过程与C++代码实现
- LeetCode 198 House Robber动态规划
- Learning how to learn - Diffuse mode thinking