【思路】:求中位数。这么水的题都写是不是显得我很low...其实我只是有强迫症而已。。
【AC代码】:
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define MAX 10000+10
int main(int argc, char** argv) {
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
int n = 0;
while (cin >> n)
{
int i = 0;
int milk[MAX];
for (i = 0; i < n; i++)
cin >> milk[i];
sort(milk, milk+n);
cout << milk[n/2] << endl;;
}
return 0;
}