Cod sursa(job #307000)

Utilizator xtremespeedzeal xtreme Data 22 aprilie 2009 18:14:53
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.51 kb
#include <iostream.h>
#include <stdio.h>
#include <vector>
using namespace std;

vector<int> w;
vector<int>::iterator it;
long int n,i,aux;

int main()
    {
    freopen("algsort.in","r",stdin);freopen("algsort.out","w",stdout);
    scanf("%ld",&n);
    for(i=1;i<=n;i++)          {scanf("%ld",&aux);w.push_back(aux);}
    sort(w.begin(),w.end());
    for(it=w.begin();it!=w.end();it++)      
                         printf("%ld ",*it);
    printf("\n");
    fclose(stdin);fclose(stdout);return 0;
}