35. 자릿수 더하기

김해준's avatar
Dec 08, 2025
35. 자릿수 더하기

사용언어 : Java

문제
notion image
풀이
class Solution { public int solution(int n) { int start = n; int answer = 0; while(start >0) { answer += start % 10; start /= 10; } return answer; } }
notion image
Share article