题解 | #牛牛的四叶玫瑰数#

牛牛的四叶玫瑰数

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

BC164 牛牛的四叶玫瑰数

思路:

step1:逐位计算;

代码如下:

def fn(m,n):
    for i in range(m,n+1):
        x = ''
        x += str(i)
        y = len(str(i))
        count = 0
        for j in range(y):
            count += (int(x[j]))**4
        if count == i:
            print(i,end=' ')
m,n = list(map(int,input().split()))
fn(m,n)
全部评论

相关推荐

notbeentak...:就抓,嗯抓,开不开匿名都要抓,一点坏事不让说,就对公司顶礼膜拜佩服的五体投地就对了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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