题解 | 牛牛的素数和

牛牛的素数和

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

l, r = map(int, input().split())
s = 0
for i in range(l, r + 1):
    f = 0
    for j in range(2,i):
        if i % j == 0:
            f = f + 1
    if f == 0:
        s = s + i
print(s)

全部评论

相关推荐

SHC2:春招先狠狠投递,然后你看看能不能申请香港新加坡的一年制master,花不了多少钱,或者现在赶紧去刷一段实习。HR专业考研没必要
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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