题解 | #自守数#
自守数
http://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
def func(x):
a = str(x * x)
b = len(str(x))
if x == int(a[-b:]):
return True
else:
return False
while True:
try:
n = int(input())
num = 0
for x in range(n+1):
if func(x):
num += 1
else:
continue
print(num)
except:
break
查看11道真题和解析
OPPO公司福利 1269人发布