Who's in the Middle

http://poj.org/problem?id=2388

 1 #include<cstdio>
 2 #include<algorithm>
 3 const int N=10010;
 4 using namespace std;
 5 int main()
 6 {
 7     int f[N],n,i;
 8     scanf("%d",&n);
 9     for (i = 1;i <= n;i ++)
10     scanf("%d",&f[i]);
11     sort(f+1,f+1+n);
12     printf("%d\n",f[(n+1)/2]);
13     return 0;
14 }
View Code

 

posted @ 2013-08-02 11:15  N_ll  阅读(113)  评论(0编辑  收藏  举报