본문 바로가기
개인공부/Algorithm(C, C++)

SW Expert Academy(2063. 중간값 찾기) C++

by 저세상판단 2021. 8. 10.
반응형

#include<iostream>
#include<algorithm>

using namespace std;

int main(int argc, char** argv)
{
int test_case;
int T;
int a[199];
cin>>T;

for(test_case = 0; test_case < T; ++test_case)
{
        cin >> a[test_case];
}
    sort(a, a+199);
    
    printf("%d", a[T/2]);

return 0;//정상종료시 반드시 0을 리턴해야합니다.
}

반응형