Cod sursa(job #2279033)
Utilizator | Data | 8 noiembrie 2018 20:38:36 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
int main()
{
int n,x;
f>>n;
std::vector<int> v;
for(int i=0; i<n; i++)
{
f>>x;
v.push_back(x);
}
std::sort(v.begin(),v.end());
for(int i=0; i<n; i++)
g<<v[i]<<" ";
return 0;
}