当前位置:网站首页>openjudge:统计数字字符个数
openjudge:统计数字字符个数
2022-07-28 05:18:00 【编程器系统】
描述
输入一行字符,统计出其中数字字符的个数。
输入
一行字符串,总长度不超过255。
输出
输出为1行,输出字符串里面数字字符的个数。
样例输入
Peking University is set up at 1898.
样例输出
4
代码1
s = input()
sum = 0
for i in s:
if '0'<= i <='9':
sum += 1
print(sum)代码2
s = input()
sum = 0
for i in s:
if i.isdigit():
sum += 1
print(sum)边栏推荐
- ByteBuffer. Position throws exception illegalargumentexception
- latex和word之间相互转换
- Flask Development & get/post request
- pytorch使用hook获得特征图
- block yandex bot
- List < long >, list < integer > convert each other
- Digital twin solutions inject new momentum into the construction of chemical parks
- 24小时内的时间段无交叉
- CentOS7安装MySQL5.7
- GET与POST区别
猜你喜欢
随机推荐
分享几种管理C程序中标志位的方法
注册中心服务eureka 切换到 nocas遇到的问题
lamda 获取当前循环数,AtomicInteger
Eccv2022 | 29 papers of Tencent Youtu were selected, including face security, image segmentation, target detection and other research directions
[singleton mode] thread safety of lazy mode
深度学习热力图可视化的方式
Response < t > class
2021CSDN博客之星评选,互投
多线程进阶:synchronized底层原理,锁优化、锁升级的过程
(黑马)MYSQL初级-高级笔记(博主懒狗)
BeanUtils. Copyproperties cannot copy different list sets problem solving lists.transform function
Redis' bloom filter
There is no crossover in the time period within 24 hours
latex使用\hl进行高亮时遇到引用总是报错,显示少了括号或者多了括号
JUC笔记
自定义Json返回数据
Printf function of input and output function in C language
正则表达式
2022 summer practice (PowerDesigner tutorial learning record) (first week)
11.< tag-动态规划和子序列, 子数组>lt.115. 不同的子序列 + lt. 583. 两个字符串的删除操作 dbc









