Skip to content

Instantly share code, notes, and snippets.

@abranhe
Created September 27, 2018 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abranhe/0272aa34f1b3e8a49dc9da11e3085ae0 to your computer and use it in GitHub Desktop.
Save abranhe/0272aa34f1b3e8a49dc9da11e3085ae0 to your computer and use it in GitHub Desktop.
Simple sort in C++
//
// Simple Sort
// Carlos Abraham He...
// github.com/abranhe
// https://repl.it/@abranhe/Simple-Sort
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> v;
v.push_back(3);
v.push_back(7);
v.push_back(15);
v.push_back(1);
cout << "Not sorted: " << endl;
for(auto item:v)
{
cout << item;
}
cout << endl;
sort(begin(v), end(v));
cout << "Sorted: " << endl;
for(auto item:v)
{
cout << item;
}
cout << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment