fork download
  1. #include <iostream>
  2. #include <array>
  3. #include <algorithm>
  4.  
  5. int main() {
  6. std::array<int, 5> arr {5,3,24,9,7};
  7.  
  8. std::sort(arr.begin(), arr.end());
  9.  
  10. std::cout << arr[0] << std::endl << arr[1];
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
3
5