def working(maxnum=100):
sums = []
for i in range(1, maxnum+1):
rootint = int(i ** 0.5)
if rootint ** 2 != i:
with decimal.localcontext() as c:
c.prec = 102
rootstr = str(decimal.Decimal(i) ** decimal.Decimal('0.5'))
rootstr = rootstr.replace('.', '')
tmpsum = 0
for j in range(100):
tmpsum += int(rootstr[j])
sums.append(tmpsum)
return sum(sums)
评论列表
文章目录