c++字符函数库 cctype
来源:互联网 发布:assert java 编辑:程序博客网 时间:2024/05/29 13:38
// isalpha() 检查是否为字母字符;// isdigit() 测试字符是否为数字字符 ;// isspace() 测试字符是否为空白,如换行符、空格和制表符;// ispunct() 测试字符是否为标点符号;#include <iostream>#include <cctype>using namespace std;int main(){ cout <<"enter txet:\n"; char ch; int chars=0; int whitespace=0; int digits=0; int punct =0; int outher=0; cin.get (ch); while (ch!='@') { if (isalpha(ch)) chars++; else if(isspace(ch)) whitespace ++; else if (isdigit(ch)) digits ++; else if (ispunct(ch)) punct ++; else outher++; cin.get (ch); } cout << chars<<" letters, "; cout <<whitespace<<" whitespae, "; cout <<digits<<" digits, "; cout <<punct <<" punctuations, "; cout <<outher <<" outhers. \n"; system("PAUSE"); }
0 0
- C/C++字符函数库cctype
- C++ 字符函数库cctype
- cctype字符函数库使用
- 字符函数库cctype
- c++字符函数库 cctype
- 字符函数库 cctype
- C++ 字符函数库cctype
- 字符函数库cctype
- 【C++】学习笔记二十三——字符函数库cctype
- (八十四)字符函数库cctype
- <cctype> C字符函数
- 实用字符处理函数库:cctype(ctype.h)
- c++字符函数库cctype使用练习
- 【C++学习笔记】字符函数库cctype
- C++:cctype中的字符函数
- [C++ Primer Plus]学习笔记 --字符函数库cctype
- 【C/C++】cctype中的字符函数
- cctype中的字符函数
- c++代码与调试
- 表情开发 在Edittext中显示表情
- 编辑文章 - 博客频道 - CSDN.NET
- 三层架构理论篇
- Ubuntu下自带的截图工具
- c++字符函数库 cctype
- Sybase在线手册
- 正则表达式基本语法
- PHP----常用正则表达式
- Effective Java实作equals() - 就是爱Java
- WinPcap 中文技术文档
- A guide to Java SimpleDateFormat in examples
- 关于HBase MVCC的设计原理以及MVCC所引起的一个scan问题
- c和c++中的时间