#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int n, m, i, j, t;
cin >> n;
for(i=1;i<=n;i++)
{
cin >> m;
int a[m];
for(j=0;j<m;j++)
{
cin >> a[j];
}
sort(a, a+m);
t = m/2;
cout << "Case " << i << ": " << a[t] << endl;
}
return 0;
}
#include<algorithm>
using namespace std;
int main()
{
int n, m, i, j, t;
cin >> n;
for(i=1;i<=n;i++)
{
cin >> m;
int a[m];
for(j=0;j<m;j++)
{
cin >> a[j];
}
sort(a, a+m);
t = m/2;
cout << "Case " << i << ": " << a[t] << endl;
}
return 0;
}
Comments
Post a Comment