当前位置:网站首页>Zzuli:1066 character classification statistics
Zzuli:1066 character classification statistics
2022-07-02 05:29:00 【Don't explode】
Title Description
Enter a line of characters , Take carriage return as the sign of the end of input . Statistics of the English letters 、 The number of numeric characters and other characters .
Input
Multiple characters , End with carriage return , Carriage return is not a valid character . The number of valid characters does not exceed 100.
Output
Output points 3 That's ok , See the output sample for the format .
The sample input Copy
Abse 4+5*3=?
Sample output Copy
letter:4 digit:3 other:5
#include <stdio.h>
int main()
{
char ch;
int letter=0,digit=0,other=0;
while(scanf("%c",&ch),ch!='\n')
{
if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z')
{
letter++;
}
else if(ch>='0'&&ch<='9')
{
digit++;
}
else
{
other++;
}
}
printf("letter:%d\ndigit:%d\nother:%d\n",letter,digit,other);
return 0;
}
边栏推荐
- 视差特效的原理和实现方法
- Fabric. JS upload local image to canvas background
- Ubuntu 20.04 installing mysql8
- Using Kube bench and Kube hunter to evaluate the risk of kubernetes cluster
- idea開發工具常用的插件合集匯總
- Gee: find the spatial distribution and corresponding time of the "greenest" in the Yellow River Basin in 2020 [pixel by pixel analysis]
- LS1046nfs挂载文件系统
- 【技术随记-08】
- Leetcode18题 【四数之和】递归解法
- Visual Studio導入
猜你喜欢
青训营--数据库实操项目
Visual studio import
Fabric.js 右键菜单
Using Kube bench and Kube hunter to evaluate the risk of kubernetes cluster
Gee series: unit 7 remote sensing image classification using GEE [random forest classification]
Software testing learning - day 4
Operator details
Visual Studio導入
Principle and implementation of parallax effect
【pyinstaller】_ get_ sysconfigdata_ name() missing 1 required positional argument: ‘check_ exists‘
随机推荐
How matlab marks' a 'in the figure and how matlab marks points and solid points in the figure
Global and Chinese market of hydrocyclone desander 2022-2028: Research Report on technology, participants, trends, market size and share
Feign realizes file uploading and downloading
线程池概述
H5 jump applet
idea开发工具常用的插件合集汇总
Online English teaching app open source platform (customized)
Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share
2022-2-15 learning xiangniuke project - Section 8 check login status
Fabric. JS iText set italics manually
Disable access to external entities in XML parsing
Ubuntu 20.04 installing mysql8
Global and Chinese markets of semiconductor laser therapeutics 2022-2028: Research Report on technology, participants, trends, market size and share
Using QA band and bit mask in Google Earth engine
XSS basic content learning (continuous update)
创新永不止步——nVisual网络可视化平台针对Excel导入的创新历程
brew install * 失败,解决方法
来啦~ 使用 EasyExcel 导出时进行数据转换系列新篇章!
Fabric.js 右键菜单
Fabric. JS activation input box