如题所述
int i=new Scanner(System.in).nextInt();
int sum=0;
while(i%10!=0){
sum+=i%10;
i=i/10;
}
System.out.println(sum);