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)