Cod sursa(job #1150292)

Utilizator c0rn1Goran Cornel c0rn1 Data 22 martie 2014 19:48:13
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.41 kb
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    freopen("algsort.in", "r", stdin);
    freopen("algsort.out", "w", stdout);
    vector <int> q;
    int n, x;
    for (scanf("%d", &n);  n--; scanf("%d", &x), q.push_back(x));
    sort(q.begin(), q.end());
    for (vector <int>::iterator it=q.begin(); it!=q.end(); printf("%d ", *it), it++);
    return 0;
}