A.cpp 449 B

123456789101112131415161718192021
  1. //
  2. // Created by jal on 2019-05-02.
  3. //
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. int main(){
  7. int n;
  8. while(cin >> n){
  9. vector<int>v(n);
  10. for(auto&i:v){
  11. cin >> i;
  12. }
  13. sort(v.begin(), v.end());
  14. if(v.size()%2==0){
  15. cout << fixed << setprecision(2) << (v[n/2-1]+v[n/2])/2.0 << endl;
  16. }else{
  17. cout << fixed << setprecision(2) << v[n/2]/1.0 << endl;
  18. }
  19. }
  20. }