Cod sursa(job #544811)

Utilizator bhaskruMarius S bhaskru Data 2 martie 2011 10:30:38
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.42 kb
#include <cstdio> 
#include <vector> 
#include <algorithm> 
using namespace std; 
 
vector <int> V; 

int main()  
{ 
int i, x, N; 
freopen("algsort.in","r",stdin); 
freopen("algsort.out","w",stdout); 
scanf("%d",&N); 
   
for(i=1; i<=N; ++i)     
{ scanf("%d",&x);        
  V.push_back(x);    }   

sort(V.begin(),V.end()); 
    
for(i=0; i<N; ++i)         
  printf("%d ",V[i]);     
return 0; 
}