int t,j;
for(j=0;j<n-1;j++)
{
for (i=0;i<n-1-j;i++)
{t=a[i];
if (a[i+1]>t)
{a[i]=a[i+1];a[i+1]=t;}
}
} double s=(a[n/2-1]+a[n/2])/2.0;
if (n%2==0){cout<<s<<endl;}
else {cout<<a[(n-1)/2]<<endl;}
#include<iostream>
using namespace std;
int main(){
int i,n=10,t=0,x=0;
double a[10],b[10],avg=0;
for (i=0;i<n;i++)
{cin>>a[i];
avg=avg+a[i];
t=t+1;}
avg=avg/t;
for (i=0;i<n;i++)
{if(a[i]<avg)
{x=x+1;}
}
cout<<avg<<" "<<x<<endl;
return 0;
}