class Solution():
def count1(self,n):
base = 1
count = 0
r = n
while r > 0:
weight = r%10
r = int(r/10)
count += r*base
if weight == 1:
count+=(n%base)+1
elif weight >1:
count+=base
base*=10
return count
s = Solution()
print(s.count1(534))
网友评论