Cod sursa(job #756795)
| Utilizator | Data | 10 iunie 2012 14:26:50 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 80 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.5 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 ());
vector <int> :: iterator it;
for (it = x.begin () ; it != x.end () ; ++it)
printf ("%d " , *it);
return 0;
}
