Created
June 27, 2016 16:22
-
-
Save tjohns/60786d942a269b7c8b7e5a9cfb93d28d to your computer and use it in GitHub Desktop.
C++ sorting example
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
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
int data[] = {2,4,3,5,1}; | |
cout << "Input: " << data[0] << data[1] << data[2] << data[3] << data[4] << endl; | |
sort(begin(data), end(data)); | |
cout << "Output: " << data[0] << data[1] << data[2] << data[3] << data[4] << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment