且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

hdu 1157

更新时间:2022-08-13 08:45:20

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1157
hint:排序

#include <iostream>
#include <algorithm>
using namespace std;
int data[10005];
int main()
{
    int m;
    while(cin>>m)
    {
        for(int i=0; i<m; i++)
            cin>>data[i];
        sort(data,data+m);
        cout<<data[m/2]<<endl;
    }
    return 0;
}