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; }