题解 | #挑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)
全部评论

相关推荐

06-26 15:33
青岛工学院 Java
积极的秋田犬要冲国企:他现在邀请我明天面试
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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