uploaded at 2022. 12. 17. 오후 10:25:44
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/12931
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class Solution {
|
||||||
|
public int solution(int n) {
|
||||||
|
int answer = 0;
|
||||||
|
for(int a : (n+"").toCharArray()){
|
||||||
|
answer += Character.getNumericValue(a);
|
||||||
|
}
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user