Created
September 27, 2018 19:46
-
-
Save abranhe/0272aa34f1b3e8a49dc9da11e3085ae0 to your computer and use it in GitHub Desktop.
Simple sort in C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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