"프로그래머스 120814 피자 나눠 먹기 (1)"의 두 판 사이의 차이

 
(같은 사용자의 중간 판 6개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;[https://school.programmers.co.kr/learn/courses/30/lessons/120814 {{PAGENAME}}]
{{프로그래머스|레벨=0|페이지=11|분류=코딩테스트 입문}}
[[분류: 프로그래머스 입문 캘린더]]
* [[프로그래머스 입문 캘린더]]


==C++==
<syntaxhighlight lang='cpp'>
#include <string>
#include <vector>
using namespace std;
int solution(int n) {
    return (n+6)/7;
}
</syntaxhighlight>
<syntaxhighlight lang='cpp'>
<syntaxhighlight lang='cpp'>
#include <string>
#include <string>
15번째 줄: 28번째 줄:
#include <string>
#include <string>
#include <vector>
#include <vector>
 
#include <cmath>
using namespace std;
using namespace std;


int solution(int n) {
int solution(int n) {
     return (n+6)/7;
     return ceil(n/7.0);
}
}
</syntaxhighlight>
</syntaxhighlight>

2023년 12월 1일 (금) 21:06 기준 최신판

1 개요[ | ]

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

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

int solution(int n) {
    return (n+6)/7;
}
#include <string>
#include <vector>

using namespace std;

int solution(int n) {
    return n/7 + (n%7>0);
}
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int solution(int n) {
    return ceil(n/7.0);
}

3 같이 보기[ | ]