poj2388

水题,排序

 

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

const int maxn = 10001;

int main()
{
	//freopen("D:\\t.txt", "r", stdin);
	int n;
	scanf("%d", &n);
	int f[maxn];
	for (int i = 0; i < n; i++)
		scanf("%d", &f[i]);
	sort(f, f + n);
	printf("%d\n", f[n / 2]);
	return 0;
}
posted @ 2011-02-01 13:59  金海峰  阅读(501)  评论(0编辑  收藏  举报