Given a none-negative number, print out the sum of its digits.
Input Format:
A none-negative integer number.
Output Format:
The sum of its all digits.
Sample Input:
123
Sample Output:
6
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
int s=0;
while(n>0)
{
s+=(n%10);
n=n/10;
}
System.out.println(s);
}
}