Skip to content

Commit

Permalink
이슈 #382에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 21, 2024
1 parent 5781b9c commit da6b9eb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Programmers/치킨_쿠폰.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <string>
#include <vector>

using namespace std;

int solution(int chicken) {
int service_chicken = 0;
int coupons = chicken;

while(coupons >= 10) {
int new_chicken = coupons / 10;
int remaining_coupons = coupons % 10;

service_chicken += new_chicken;
coupons = new_chicken + remaining_coupons;
}

return service_chicken;
}

0 comments on commit da6b9eb

Please sign in to comment.