累加器计算各个位数之和 使用累加器 使用累加器 sums。创建一个累加器对象。 sums=0 #int:数字必须是整型 n=int(input('请输入一个整数:')) # 创建累加器 sum=0 while n!=0: # 获取n的最后的个位数 a=n