题解 | #挑7#

挑7

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

n = int(input())
sum = 0
C = '7'

for i in range(1, n+1):
    if i % 7 == 0:
        sum += 1
    elif C in str(i):
        sum += 1
print(sum)

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务