当前位置:网站首页>760. String length
760. String length
2022-07-26 09:11:00 【Hunter_ Kevin】
subject
The length of a given line does not exceed 100 Non empty string for , Please find out its specific length .
Input format
The input line , Represents a string . Note that the string may contain spaces .
Output format
Output an integer , It means its length .
Data range
1≤ String length ≤100
No carriage return at the end of the string
sample input :
I love Beijing.
sample output :
15
Code
#include <iostream>
using namespace std;
int main()
{
int len = 0;
char ch;
while((ch = getchar()) && ch != '\0')
len++;
cout<<len<<endl;
return 0;
}
quote
AcWing 760. String length ( Commonly used ones that do not ignore spaces 4 String reading methods )
边栏推荐
- Unity topdown character movement control
- Learning notes of automatic control principle - Performance Analysis of continuous time system
- NFT与数字藏品到底有何区别?
- 数据库操作技能7
- 机器学习中的概率模型
- Node-v download and application, ES6 module import and export
- 【ARKit、RealityKit】把图片转为3D模型
- Probability model in machine learning
- [recommended collection] MySQL 30000 word essence summary - query and transaction (III)
- Babbitt | metauniverse daily must read: does the future of metauniverse belong to large technology companies or to the decentralized Web3 world
猜你喜欢
Cat安装和使用
Database operation topic 2
优秀的 Verilog/FPGA开源项目介绍(三十零)- 暴力破解MD5
【LeetCode数据库1050】合作过至少三次的演员和导演(简单题)
CSDN Top1 "how does a Virgo procedural ape" become a blogger with millions of fans through writing?
Two tips for pycharm to open multiple projects
布隆过滤器
jvm命令归纳
CF1481C Fence Painting
209. Subarray with the smallest length
随机推荐
【ARKit、RealityKit】把图片转为3D模型
机器学习中的概率模型
Numpy Foundation
论文笔记: 知识图谱 KGAT (未完暂存)
Codeworks DP collection
聪明的美食家 C语言
Day06 operation -- addition, deletion, modification and query
Error: Cannot find module ‘umi‘ 问题处理
分布式跟踪系统选型与实践
at、crontab
CSDN TOP1“一个处女座的程序猿“如何通过写作成为百万粉丝博主?
Matlab 绘制阴影误差图
"No input file specified" problem handling
unity简易消息机制
ext4文件系统打开了DIR_NLINK特性后,link_count超过65000的后使用link_count=1来表示数量不可知
深度学习常用激活函数总结
C# Serialport的发送和接收
PAT 甲级 A1013 Battle Over Cities
PHP 之 Apple生成和验证令牌
Day06 homework -- skill question 2