Mbpp/598

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度389 字符
模型生成的代码 (389 字符)
def armstrong_number(num: int) -> bool:
    """
    Check whether the given number is an Armstrong number.
    An Armstrong number is a number that equals the sum of its own digits
    each raised to the power of the number of digits.
    e.g., 153 = 1^3 + 5^3 + 3^3.
    """
    digits = [int(d) for d in str(num)]
    power = len(digits)
    return sum(d ** power for d in digits) == num
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试