uploaded at 2022. 12. 16. 오전 1:09:37

This commit is contained in:
rl544
2022-12-16 01:09:38 +09:00
parent 83023ab0ae
commit 824bd07d7b
+15
View File
@@ -0,0 +1,15 @@
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/132267
class Solution {
public int solution(int a, int b, int n) {
int answer = 0;
int c = 0;
while(n >= a){
c = n/a;
n = n + c * (b - a);
answer += c * b;
System.out.println(answer);
}
return answer;
}
}