fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <array>
  4. using namespace std;
  5.  
  6. int main() {
  7. std::array<int,10> myArray{10,9,8,7,6,5,4,3,2,1};
  8. std::partial_sort(myArray.begin(),myArray.begin()+1,myArray.end(), [](const int& lhs, const int& rhs){return lhs < rhs;});
  9. cout << myArray[0];
  10. return 0;
  11. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
1