Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
74652 汤弘毅 水仙花数II Python3 Accepted 34 MS 3792 KB 295 2024-05-25 16:52:26

Tests(10/10):


Code:

n,m = map(int,input().split()) cnt = 0 for i in range(n,m+1): s = str(i) a,b,c = int(s[0]),int(s[1]),int(s[2]) if (a**3 + b**3 + c**3) == i: cnt += 1 if i == m: print(i) else: print(i,end = ' ') if cnt == 0: print('no')