1066: 字符分类统计
2017-09-03 19:05
323 查看
1066: 字符分类统计
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 10446 Solved: 5614
SubmitStatusWeb
Board
Description
输入一行字符,以回车符作为输入结束的标志。统计其中英文字母、数字字符和其他字符的个数。Input
多个字符,以回车符结束,回车符不作为有效字符。有效字符个数不超过100。Output
输出分3行,格式见输出样例。Sample Input
Abse 4+5*3=?Sample Output
letter:4digit:3other:5HINT
Source
*#include<stdio.h>
int main()
{
int l,d,o;
char ch;
l=0;
d=0;
o=0;
while(scanf("%c",&ch), ch!='\n')
{
if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
l=l+1;
else if(ch>='0'&&ch<='9')
d=d+1;
else
o=o+1;
}
printf("letter:%d\ndigit:%d\nother:%d\n",l,d,o);
return 0;
}
相关文章推荐
- zzuli OJ 1066: 字符分类统计
- 轻院1066: 字符分类统计
- zzuli 1066 java 字符分类统计
- zzuli OJ 1066: 字符分类统计
- 汇编实验:分类统计字符个数
- 对输出的字符进行分类的输出,并进行标点符号的统计
- 输入字符,统计分类
- 汇编实验——分类统计字符个数count_char
- 用80x86汇编语言编程:分类统计字符个数
- 1053 字符分类统计
- 6-1 分类统计字符字数
- 汇编实验,字符分类统计,提示的错误总结
- python实现字符串中字符分类及个数统计
- C++实现分类统计字符串中字符个数
- 编写一个函数,计算字符串中含有的不同字符的个数。字符在ACSII码范围内(0~127)。不在范围内的不作统计。
- 1042. 字符统计(20)
- 字符统计
- 学习C/C++语言:字符数组的使用,统计字符串中单词个数
- 车牌识别技术详解五--采用LBP+HOG SVM做目标分类,车牌检测,字符检测等
- C语言统计一串字符中空格键、Tab键、回车键、字母、数字及其他字符的个数(Ctrl+Z终止输入)