Cod sursa(job #293833)

Utilizator gabitzish1Gabriel Bitis gabitzish1 Data 2 aprilie 2009 08:53:11
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.56 kb
#include <stdio.h>
#include <deque>
#include <algorithm>
#include <limits.h>
//#include <mem.h>
//#include <value.h>
using namespace std;

int N, Mn, Pz;
deque <int> v;

int cmp(const int &x, const int &y)
{
	return x < y;
}

int main()
{
	freopen("algsort.in","r",stdin);
	freopen("algsort.out","w",stdout);
	scanf("%d",&N);
	int i, x;
	x = INT_MAX;
	for (i = 0; i < N; i++) 
		{
			scanf("%d",&x);
			v.push_back(x);
	}
	sort(v.begin(), v.end(), cmp);	
	for (i = 0; i < N; i++)
	{
		printf("%d ",v[0]);
		v.pop_front();
	}
	return 0;
}