Problem P

题意:FJ养牛,他想知道中间的牛是那一头;
思路:这道题有点水,思路就不写了
#include
#include
#include
#define maxn 10005
using namespace std;
bool comp(int a,int b)
{
    return a
}
int ans[maxn];
int main()
{
    //freopen("in.txt", "r", stdin);
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        for(int i=0;i
    {
        scanf("%d",&ans[i]);
    }
    sort(ans,ans+n,comp);
    printf("%d\n",ans[n/2]);
    }
    return 0;
   
}
posted @ 2016-03-13 17:54  勿忘初心0924  阅读(138)  评论(0编辑  收藏  举报