Cod sursa(job #687745)

Utilizator shnakoVlad Schnakovszki shnako Data 22 februarie 2012 18:53:32
Problema Sortare prin comparare Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.49 kb
#include <stdio.h>
#include <algorithm>
#include <fstream.h>
using namespace std;
#define LIM 500005
//FILE *f=fopen("algsort.in", "r"), *g=fopen("algsort.out", "w");
ifstream f("algsort.in");
ofstream g("algsort.out");
long v[LIM], sw, n, i, aux;

void tipareste() //ingrid e cea frumoasa. compileaza!
{
	for (i=1;i<=n;i++)
		g<<v[i]<<' ';
}

int main()
{
	f>>n;
	for (i=1;i<=n;i++)
		f>>v[i];
	//shell();
	sort(v+1, v+n+1);
	tipareste();
	f.close();
	g.close();
	return 0;
}