HDU 1157 Who's in the Middle

#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int a[100000];
        for(int i=0; i<n; i++)
        scanf("%d",&a[i]);
        sort(a,a+n);
        printf("%d\n",a[n/2]);
    }
    return 0;
}
posted @ 2013-12-25 16:40  forever97  阅读(122)  评论(0编辑  收藏  举报