题解 | #自守数#
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
def f(x): if str(x*x)[-len(str(x)):] == str(x): return True return False n = int(input()) c = 0 for i in range(n+1): if f(i): c += 1 print(c)
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
def f(x): if str(x*x)[-len(str(x)):] == str(x): return True return False n = int(input()) c = 0 for i in range(n+1): if f(i): c += 1 print(c)
相关推荐