- Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathvector-sort.cpp
More file actions
Latest commit
30 lines (24 loc) · 539 Bytes
/
Copy pathvector-sort.cpp
File metadata and controls
30 lines (24 loc) · 539 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// https://www.hackerrank.com/challenges/vector-sort/problem
#include<cmath>
#include<cstdio>
#include<vector>
#include<iostream>
#include<algorithm>
usingnamespacestd;
intmain()
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int N, x;
vector<int> v;
cin >> N;
for (int i = 0; i < N; ++i)
{
cin >> x;
v.push_back(x);
}
std::sort(v.begin(), v.end());
for (constauto& i :v)
cout << i << "";
cout << endl;
return0;
}