1 #include2 #include 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 }
本文共 360 字,大约阅读时间需要 1 分钟。
1 #include2 #include 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 }
转载于:https://www.cnblogs.com/lahblogs/p/3232147.html