Cod sursa(job #1403130)
Utilizator | Data | 27 martie 2015 01:58:36 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
vector <long long int> v;
int n;
int main()
{
fstream f("algsort.in", ios::in);
fstream g("algsort.out", ios::out);
f>>n;
for(int i = 1; i <= n; ++i)
{
int x;
f>>x;
v.push_back(x);
}
std::sort(v.begin(), v.end());
for(int i = 0; i< n; ++i)
g<<v[i]<<' ';
}