第26200题 判断题
判断给定代码是否能正确通过枚举算法找出所有各位数字立方和等于自身的三位数

以下代码是使用枚举算法,找出所有各位数字的立方和等于该数本身的三位数。

for num in range(100, 1000):
    hundreds = num // 100
    tens = (num // 10) % 10
    units = num % 10
    if hundreds**3 + tens**3 + units**3 == num:
        print(num)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析