diff --git "a/Programmers/\354\271\230\355\202\250_\354\277\240\355\217\260.cpp" "b/Programmers/\354\271\230\355\202\250_\354\277\240\355\217\260.cpp" new file mode 100644 index 0000000..79245f4 --- /dev/null +++ "b/Programmers/\354\271\230\355\202\250_\354\277\240\355\217\260.cpp" @@ -0,0 +1,19 @@ +#include +#include + +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; +} \ No newline at end of file