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 ",f[(n+1)/2]); 13 return 0; 14 }