标签:poj
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 31015 | Accepted: 17991 |
Description
Input
Output
Sample Input
5 2 4 1 3 5
Sample Output
3
Hint
一道排序水题。
#include<cstdio>
#include<stdlib.h>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const int M = 10000 + 5;
int cow[M];
int main()
{
int n;
while(scanf("%d", &n)!=EOF)
{
memset(cow, 0, sizeof(cow));
for(int i=0; i<n; i++)
scanf("%d", &cow[i]);
sort(cow, cow+n);
printf("%d\n", cow[n/2]);
}
return 0;
}
POJ 2388:Who's in the Middle,布布扣,bubuko.com
标签:poj
原文地址:http://blog.csdn.net/u013487051/article/details/37502451