题解 | #自守数#
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
L = []
def fun(n):
nn = n*n
if str(n) == str(nn)[-len(str(n)):]:
L.append(n)
for i in range(int(input())+1):
fun(i)
print(len(L))
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
L = []
def fun(n):
nn = n*n
if str(n) == str(nn)[-len(str(n)):]:
L.append(n)
for i in range(int(input())+1):
fun(i)
print(len(L))
相关推荐