Playground/자바문제집

[프로그래머스] 치킨 쿠폰

미숫가루설탕많이 2023. 2. 5. 22:13
class Solution {
    public int solution(int chicken) {
        int answer = 0;
        int count = chicken;
        
        while (count > 9) {
            answer += count / 10;
            count = count / 10 + count % 10;
        }
        return answer;
    }
}