fork download
  1. #ifndef RECURSION11_H_
  2. #define RECURSION11_H_
  3.  
  4. #include <iostream>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int solve(int n, int arr[], int k);
  10.  
  11. int median(int arr[], int sz) {
  12. int m = sz / 2;
  13. nth_element(arr, arr + m, arr + sz);
  14. return arr[m];
  15. }
  16.  
  17. int main() {
  18. int n, k;
  19. cin >> n >> k;
  20.  
  21. int* arr = new int[n];
  22. for (int i = 0; i < n; ++i) {
  23. cin >> arr[i];
  24. }
  25.  
  26. cout << solve(n, arr, k) << "\n";
  27. }
  28.  
  29. #endif // RECURSION11_H_
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /home/MN6YnW/ccvTa2BQ.o: in function `main':
prog.cpp:(.text.startup+0x91): undefined reference to `solve(int, int*, int)'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty