"프로그래머스 120811 중앙값 구하기"의 두 판 사이의 차이

(새 문서: ==개요== ;[https://school.programmers.co.kr/learn/courses/30/lessons/120811 {{PAGENAME}}] <syntaxhighlight lang='cpp'> #include <string> #include <vector> #include <algorithm> usi...)
 
1번째 줄: 1번째 줄:
==개요==
==개요==
;[https://school.programmers.co.kr/learn/courses/30/lessons/120811 {{PAGENAME}}]
{{프로그래머스|레벨=0}}
* [[프로그래머스 입문 캘린더]]


==C++==
<syntaxhighlight lang='cpp'>
<syntaxhighlight lang='cpp'>
#include <string>
#include <string>

2023년 11월 9일 (목) 00:52 판

1 개요

프로그래머스 120811 중앙값 구하기

2 C++

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int solution(vector<int> array) {
    sort(array.begin(), array.end());
    return array[array.size()/2];
}

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}