题解 | #自守数#
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
n=int(input())
count=0
for i in range(0,n+1):
#变成字符串后进行切片
if str(i)==str(i*i)[-len(str(i)):]:
count+=1
print(count)
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
n=int(input())
count=0
for i in range(0,n+1):
#变成字符串后进行切片
if str(i)==str(i*i)[-len(str(i)):]:
count+=1
print(count)
相关推荐