Created
May 5, 2019 10:44
-
-
Save lazycipher/d55debe87f5e442270625dee1ec26055 to your computer and use it in GitHub Desktop.
Vector-Sort HackerRank Practice
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 <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
vector<int> ins; | |
int n; | |
cin>>n; | |
for(int i = 0; i<n; i++){ | |
int val; | |
cin>>val; | |
ins.push_back(val); | |
} | |
sort(ins.begin(), ins.end()); | |
for (int i = 0; i < n; i++){ | |
cout<<ins[i]<<" "; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment