1 solutions

  • 2
    @ 2025-9-29 17:22:27
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	vector<int> v;
    	int x;
    	while(cin>>x,x)
    	{
    		v.push_back(x);
    	} 
    	sort(v.begin(),v.end());
    	if(v.size()%2!=0)
    	{
    		cout<<v[v.size()/2];
    	}
    	else
    	{
    		cout<<(v[v.size()/2]+v[v.size()/2-1])/2.0<<endl;
    	}
    	return 0;
    }
    
    
    • 1

    Information

    ID
    149
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    69
    Accepted
    32
    Uploaded By