题解 | #自守数#

自守数

https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e

num = int(input())
count = 0
for i in range(num+1):
    pinfang = i ** 2
    str_pinfang = str(pinfang)
    str_i = str(i)
    if str_pinfang[-len(str_i):] == str_i:
        count += 1

print(count)


全部评论

相关推荐

用微笑面对困难:这里面最强的是驾驶证了,可以入职美团大厂,然后直接开启黄马褂人生
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务