fork(2) download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. int main() {
  5. int a[] = {2, 1, 2, 3, 4};
  6. std::nth_element(a, a+2, a+5);
  7. std::cout << a[1];
  8. return 0;
  9. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
1