Skip to content

Instantly share code, notes, and snippets.

@lazycipher
Created May 5, 2019 10:44
Show Gist options
  • Save lazycipher/d55debe87f5e442270625dee1ec26055 to your computer and use it in GitHub Desktop.
Save lazycipher/d55debe87f5e442270625dee1ec26055 to your computer and use it in GitHub Desktop.
Vector-Sort HackerRank Practice
#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