Cod sursa(job #538971)

Utilizator brainwashed20Alexandru Gherghe brainwashed20 Data 22 februarie 2011 10:01:31
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.33 kb
#include<fstream>
#include<algorithm>

using namespace std;

#define Nmax 500000

int V[Nmax], N;

ifstream f("algsort.in");
ofstream g("algsort.out");

int main() {
	int i;
	
	f>>N;
	for(i=0; i<N; i++)
		f>>V[i];
	sort(V,V+N);
	for(i=0; i<N; i++)
		g<<V[i]<<" ";
	g<<"\n";
	
	f.close();
	g.close();
	
	return 0;
}