python"># -*- coding:utf-8 -*- class Solution: def NumberOf1Between1AndN_Solution(self, n): count = 0 for item in range(1,n+1): pstr = str(item) count += pstr.count('1') return count
python 整数中1出现的次数(从1到n整数中1出现的次数)
最后更新 2018-05-18 08:00 星期五 所属:
Python教程 浏览:502