题解 | #自守数#
自守数
http://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
while True:
try:
a = int(input())
res = 0
for i in range(a+1):
b =str(i * i)
if b[len(b)-len(str(i)):len(b)] == str(i):#注意只有字符串i才能取长度
res+=1
print(res)
except:
break