fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iterator>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int a[]{10, 48, 57, 23, -1, 12};
  10.  
  11. cout << "Is sorted? " << boolalpha << is_sorted(begin(a), end(a)) << endl;
  12. sort(begin(a), end(a));
  13. for(auto v : a)
  14. cout << v << '\n';
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Is sorted? false
-1
10
12
23
48
57