统计字符串中大写字母的个数
2015-09-24 18:31
337 查看
#include "stdio.h" #include "malloc.h" int numberofUpper(char*ch) { char*p; int count=0; p=ch; if(p==NULL) return 0; while(*p!='\0') { while(*p>='0'&&*p<='9') { count++; } p++; } return count; } int main() { char*str; int num; str=(char*)malloc(100); gets(str); num=numberofUpper(str); printf("%d\n",num); return 0; }
相关文章推荐
- 软件工程 第七版 摘抄
- Core Animation编程
- 奇特bug
- 模仿微信语音聊天功能(3) 核心部分,录音功能的实现
- partition list
- poj_2559 单调栈
- Shtirlits - SGU 125(搜索)
- 回车 换行区别,怎么读入char型vector
- notes for pyspider
- shell split
- SFTP文件上传与下载
- Mysql导入导出命令
- css防止ul下的li换行(li超出宽度变成…)代码
- 转 Java集合框架的基本接口/类层次结构
- JVM启动参数详解
- 【详解】回车 换行 0X0D 0X0A CR LF \R \N WIN LINUX MAC系统
- struts2 下载
- mysql基本命令
- POJ 3189 Steady Cow Assignment
- head first python 读书笔记(十二)