题目链接

leetcode原题

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
const int INF = 0x3fffffff;
int m,n,x; 
int arr[100];
int k=0;
vector<int> v;
vector<int> G[maxn];
int main(){
    char c;
    getchar(); 
    while(cin>>x){
        c = getchar();
        v.push_back(x);
        if(c == ']') break;
    }
    sort(v.begin(), v.end());
    cout<<v[v.size()/2]<<endl;
    return 0;
}