Cod sursa(job #1670627)
Utilizator | Data | 31 martie 2016 21:39:11 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
int main()
{
vector<int> a;
int n,x;
f>>n;
for(int i=0;i<n;i++)
f>>x,a.push_back(x);
sort(begin(a),end(a));
for(int i=0;i<n;i++)
g<<a[i]<<" ";
}