[Java] 프로그래머스 - 피자 나눠 먹기(1)

박철현·2023년 3월 7일

프로그래머스

목록 보기
2/80

프로그래머스 - 피자 나눠 먹기(1)

class Solution {
    public int solution(int n) {
        int 판수 = n/7;
        n = n%7;
        if(n>0)
            판수++;
        return 판수;
    }
}
profile
비슷한 어려움을 겪는 누군가에게 도움이 되길

0개의 댓글