import java.util.Scanner; public class Main6 { public static void main(String[] args) { Scanner input = new Scanner(System.in); Long n = input.nextLong(); int cnt = 0; while(n!=0){ cnt+=n%10; n/=10; } System.out.println(cnt); } }
11-24
223
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-29
167
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)