当前位置:网站首页>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;
}边栏推荐
- centos8安装mysql8.0.22教程
- 7.TCP的十一种状态集
- Fabric. JS 3 APIs to set canvas width and height
- Installation du tutoriel MySQL 8.0.22 par centos8
- Gee series: unit 9 generate sampling data in GEE [random sampling]
- JVM class loading mechanism
- Fabric.js IText设置指定文字的颜色和背景色
- Common protocols and download paths of NR
- LS1046nfs挂载文件系统
- 黑马笔记---Map集合体系
猜你喜欢

With an amount of $50billion, amd completed the acquisition of Xilinx

Gee series: Unit 2 explore datasets

"Original, excellent and vulgar" in operation and maintenance work

Operator details

Fabric.js 右键菜单

Fabric.js 激活输入框

Paddlepaddle project source code

【pyinstaller】_ get_ sysconfigdata_ name() missing 1 required positional argument: ‘check_ exists‘

2022-2-14 learning xiangniuke project - section 23, section 5, development login and exit functions

LS1046nfs挂载文件系统
随机推荐
Fabric. JS three methods of changing pictures (including changing pictures in the group and caching)
Draw a wave chart_ Digital IC
Fabric. JS compact JSON
460. LFU cache bidirectional linked list
LS1046nfs挂载文件系统
Gee: remote sensing image composite and mosaic
Basic use of form
Fabric.js IText 上标和下标
Fabric. JS activation input box
小程序跳装到公众号
Php/js cookie sharing across domains
Creation and destruction of function stack frames
Sliding window on the learning road
Disable access to external entities in XML parsing
Foreign trade marketing website system development function case making
Reflection of the soul of the frame (important knowledge)
centos8安裝mysql8.0.22教程
LeetCode 1175. Prime number arrangement (prime number judgment + Combinatorial Mathematics)
Principle and implementation of parallax effect
Leetcode 18 problem [sum of four numbers] recursive solution