Cod sursa(job #756788)
| Utilizator | Data | 10 iunie 2012 14:21:36 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 80 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <vector>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n,a;
vector <int> x;
int main()
{
freopen ("algsort.in" , "r" , stdin);
freopen ("algsort.out" , "w" , stdout);
scanf ("%d" , &n);
for (int i = 1 ; i <= n ; i++)
{
scanf ("%d" , &a);
x.push_back (a);
}
sort(x.begin(), x.end());
for (int i = 0 ; i < n ; i++)
printf ("%d " , x[i]);
return 0;
}
