inblog logo
|
stupefyee
    알고리즘문제풀기

    [JAVA 문제 풀이] 215. 자릿수 더하기

    프로그래머스 (12931)
    Stupefyee's avatar
    Stupefyee
    Apr 22, 2025
    [JAVA 문제 풀이] 215. 자릿수 더하기
    Contents
    내가 작성한 코드
    school.programmers.co.kr
    https://school.programmers.co.kr/learn/courses/30/lessons/12931
    notion image
     

    내가 작성한 코드

    public class Solution { public int solution(int n) { int answer = 0; while(n > 0) { answer += n % 10; n /= 10; } return answer; } }
    Share article
    Contents
    내가 작성한 코드

    stupefyee

    RSS·Powered by Inblog