Who's in the Middle
#include<iostream>
#include<string>
using namespace std;
int main(){
int m;
int n;
int a[10005];
int temp;
while(cin>>m){
for(int i = 0; i < m; i++){
cin>>n;
a[i] = n;
}
for(int i = 0; i < m - 1; i++){
for(int j = 0; j < m - 1 - i; j++){
if(a[j] > a[j + 1]){
temp = a[j + 1];
a[j + 1] = a[j];
a[j] = temp;
}
}
}
cout<<a[m / 2]<<endl;
}
}