Problem
Problem URL : 자릿수 더하기
[1] Answer Code (18. 07. 24)
int solution(int n)
{
int answer = 0;
while (n!=0) {
answer += n % 10;
n /= 10;
}
return answer;
}
[1] Answer Code (18. 07. 24)
- 무난 ~
Problem URL : 자릿수 더하기
int solution(int n)
{
int answer = 0;
while (n!=0) {
answer += n % 10;
n /= 10;
}
return answer;
}