python 各个位数相加. 您可以使用以下代码来计算Python 中一个数的各个位数的和: def sum_of_digits(n): return sum(int(i) for i in str(n)) print(sum_of_digits(1234)) ...
確定! 回上一頁