📌  相关文章
📜  python程序使用while循环查找数字的数字总和 - TypeScript代码示例

📅  最后修改于: 2022-03-11 14:48:25.393000             🧑  作者: Mango

代码示例1
#  Write a Program to display sum of all digits of a given
#  Number N by user

n = int(input('Enter a number : '))
sum=0

while(n>0):
    rem = n%10
    sum = sum+rem
    n = n//10
print('reversed no. is : ',int(sum))