Coding Test/프로그래머스
[프로그래머스/자바] 피자 나눠 먹기 (3)
yurison
2023. 3. 28. 09:30
class Solution {
public int solution(int slice, int n) {
int answer = n/slice;
if(n%slice >= 1){
answer ++;
}
return answer;
}
}
class Solution {
public int solution(int slice, int n) {
return n % slice > 0 ? n/slice+1 : n/slice;
}
}