https://school.programmers.co.kr/learn/courses/30/lessons/12931
public class Solution {
public int solution(int n) {
int answer = 0;
String s = Integer.toString(n);
for(int i = 0; i < s.length(); i++){
answer += Integer.parseInt(s.substring(i, i+1));
}
return answer;
}
}