题解 | #挑7#

挑7

https://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b

n = int(input())
num = []
for i in range(1, n+1):
    num.append(i)
num_7 = []
for i in num:
    if i % 7 == 0:
        num_7.append(i)

for i in num:
    for j in range(len(str(i))):
        if str(i)[j] == '7' and i not in num_7:
            num_7.append(i)
print(len(num_7))

全部评论

相关推荐

03-10 00:15
已编辑
快手_测试开发(实习员工)
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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