不挂科搜题免费

问题:

编写一个程序,实现输入一个整数,输出该整数的各位数字之和。

答案:

以下是一个简单的Python程序示例:```pythondef sum_of_digits(n):return sum(int(digit) for digit in str(n))#