https://school.programmers.co.kr/learn/courses/30/lessons/120884
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
문제 분석

코드
class Solution {
public int solution(int chicken) {
int count = 0;
int restCoupons = 10;
int temp1 = 0;
int temp2 = 0;
while(restCoupons >= 10){
temp1 = chicken/10;
temp2 = chicken%10;
restCoupons = temp1 + temp2;
count += temp1;
chicken = restCoupons;
}
return count;
}
}
뭔가 코드가... 너무 초보틱하다 ㅠ
'알고리즘 > 문제' 카테고리의 다른 글
| [프로그래머스] 삼총사 / java (0) | 2022.11.06 |
|---|---|
| [프로그래머스] 다음에 올 숫자 / java (0) | 2022.11.05 |
| [프로그래머스] 등수 매기기 / java (0) | 2022.10.28 |
| [프로그래머스] 직사각형 넓이 구하기 / java (0) | 2022.10.26 |
| [프로그래머스] 특이한 정렬 / java (0) | 2022.10.25 |