fork download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4.  
  5. int main ()
  6. {
  7. int myints[] = {32,71,12,45,26,80,53,33};
  8.  
  9. std::cout<< "Unsorted:\n";
  10. for (auto i : myints) std::cout<< i<< '\n';
  11.  
  12. std::sort (myints, myints + 8);
  13.  
  14. std::cout<< "Sorted:\n";
  15. for (auto i : myints) std::cout<< i<< '\n';
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Unsorted:
32
71
12
45
26
80
53
33
Sorted:
12
26
32
33
45
53
71
80