#include #include #include int main() { int num = 0; int nums[1000] = { 0 }; int a = 0; int b = 0; float ans = 0; scanf("%d", &num); for (int i = 0;i < num;i++) { scanf("%d", &nums[i]); } for (int i = 0;i < num;i++) { for (int j = i + 1;j < num;j++) { if (nums[j] < nums[i]) { int tmp = nums[i]; nums[i] = nums[j]; nums[j] = tmp; } } } if (num % 2 == 0) { int c = 0; int index = (num / 2) - 1; if (index < 0) { index = 0; } a = nums[num / 2]; b = nums[index]; c = a + b; ans = (float)c / 2; } else { ans = nums[num / 2]; } printf("%.0f\n", ans); return 0; }