1118: Tom数-题解(python) 摘要:解题思路:注意事项:参考代码:while True: a = input() l = [] for i in a: l.append(int(i)) m = su…… 题解列表 2021年10月19日 0 点赞 0 评论 154 浏览 评分:0.0
编写题解 1118: Tom数 摘要:解题思路:注意事项:参考代码:while True: try: print(sum(list(map(int, input())))) except: …… 题解列表 2024年04月10日 0 点赞 0 评论 308 浏览 评分:0.0
Tom数——求各个位上的数子之和 摘要:解题思路:注意事项:输入好像……,我看到之前有个作者用这种方法,我就参考了一下,具体原因我也不太清楚,希望有懂的同学留言一下参考代码:import sysfor i in sys.stdin: …… 题解列表 2023年03月17日 0 点赞 0 评论 101 浏览 评分:0.0
1118一行解(Python) 摘要:解题思路:大体就是将字符串中的每一个元素添加进列表,用sum对列表求和注意事项:注意最后一个元素为'\n'时要去除参考代码:import sysfor line in sys.stdi…… 题解列表 2022年11月08日 0 点赞 0 评论 108 浏览 评分:0.0
小南解题--Tom数--97ms 摘要:try: while 1: a=input() sum=0 for i in a: sum+=int(i…… 题解列表 2022年06月01日 0 点赞 0 评论 203 浏览 评分:0.0
1行代码直接ac 摘要:解题思路:注意事项:参考代码 : while True: print(sum([int(i) for i in input()]))…… 题解列表 2022年04月06日 0 点赞 0 评论 201 浏览 评分:0.0
字符与数字的转换,列表求和 摘要:解题思路:外层循环保证持续输入,列表d需要结束后恢复空列表注意事项:参考代码:while True: a=int(input()) d=[] for i in str(a): …… 题解列表 2022年04月05日 0 点赞 0 评论 215 浏览 评分:0.0
编写题解 1118: Tom数 摘要:解题思路:注意事项:参考代码:while True: try: n = str(input()) sum = 0 for i in n: …… 题解列表 2021年12月10日 0 点赞 0 评论 305 浏览 评分:0.0
Tom数-题解(Python代码) 摘要:```python import sys while True: line = sys.stdin.readline().strip() if not line: …… 题解列表 2021年04月11日 0 点赞 0 评论 252 浏览 评分:0.0
python解决Tom数 摘要:参考代码:def DigitCount(n): result = 0 while n != 0: result += n % 10 题解列表 2021年03月20日 0 点赞 0 评论 243 浏览 评分:0.0