题解 | #挑7#

挑7

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

n = int(input())
count = 0
for i in range(n):
    num = i + 1
    divisible = num % 7
    include_seven = False
    for j in range(len(str(num))):
        if str(num)[j] == '7':
            include_seven = True
    if divisible == 0 or include_seven:
        count += 1
print(count)
全部评论

相关推荐

我是小红是我:学校换成中南
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务