题解 | #自守数#
自守数
http://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
while True:
try:
n = int(input())
output=0
for i in range(n+1):
sq=i*i
str_sq=str(sq)
str_i =str(i)
num = len(str_i)
if str_i==str_sq[-num:]:
output+=1
print(output)
except:
break