现在的位置: 首页 > 综合 > 正文

POJ 2388 Who’s in the Middle

2012年09月29日 ⁄ 综合 ⁄ 共 184字 ⁄ 字号 评论关闭

简单的排序、、sort水过啊、、

#include <stdio.h>
#include <algorithm>
int main()
{
    int i, n, f[10100];
    while(~scanf("%d",&n))
    {
        for(i = 0; i < n; i++)
        scanf("%d",&f[i]);
        std::sort(f, f+n);
        printf("%d\n",f[n/2]);
    }
    return 0;
}

抱歉!评论已关闭.