当前位置:网站首页>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 )
边栏推荐
猜你喜欢

巴比特 | 元宇宙每日必读:元宇宙的未来是属于大型科技公司,还是属于分散的Web3世界?...

Day06 homework -- skill question 1

JS file import of node

Cat安装和使用

高数 | 武爷『经典系列』每日一题思路及易错点总结

NPM add source and switch source

Polynomial open root

(2006,Mysql Server has gone away)问题处理

李沐d2l(四)---Softmax回归

What is the difference between NFT and digital collections?
随机推荐
CF1481C Fence Painting
Simple message mechanism of unity
巴比特 | 元宇宙每日必读:元宇宙的未来是属于大型科技公司,还是属于分散的Web3世界?...
HBuilderX 运行微信开发者工具 “Fail to open IDE“报错解决
Probability model in machine learning
优秀的 Verilog/FPGA开源项目介绍(三十零)- 暴力破解MD5
The idea shortcut key ALT realizes the whole column operation
语音聊天app源码——钠斯直播系统源码
Two tips for pycharm to open multiple projects
高数 | 武爷『经典系列』每日一题思路及易错点总结
Hbuilderx runs the wechat developer tool "fail to open ide" to solve the error
STM32+MFRC522完成IC卡号读取、密码修改、数据读写
Node-v download and application, ES6 module import and export
TCP solves the problem of short write
pycharm 打开多个项目的两种小技巧
Introduction to excellent verilog/fpga open source project (30) - brute force MD5
Day 6 summary & database operation
Summary of common activation functions for deep learning
Qt | 关于如何使用事件过滤器 eventFilter
Uploading pictures on Alibaba cloud OSS