Cod sursa(job #410334)

Utilizator znakeuJurba Andrei znakeu Data 4 martie 2010 11:51:18
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.48 kb
// damn.. I haven't submited anything here in a year or something...

#include <stdio.h>
#include <algorithm>

using namespace std;

const int MAXN=500001;
int V[MAXN],N;

int main()
{
	int i;
	
	FILE *input=fopen("algsort.in","r");
	FILE *output=fopen("algsort.out","w");
	
	fscanf(input,"%d",&N);
	for (i=0; i<N; ++i)
		fscanf(input,"%d",&V[i]);
	
	sort(V,V+N);
	
	for (i=0; i<N; ++i)
		fprintf(output,"%d ",V[i]);
	
	fclose(input);
	fclose(output);
	return 0;
}