Cod sursa(job #293727)

Utilizator gabitzish1Gabriel Bitis gabitzish1 Data 2 aprilie 2009 00:50:37
Problema Sortare prin comparare Scor 0
Compilator cpp Status done
Runda infoexpert Marime 0.37 kb
#include <cstdio>
#include <algorithm>
using namespace std;
int v[1000005];

int cmp(const int &a, const int &b)
{
	return a < b;
}

int main()
{
int a, b;
freopen("algsort.in","r",stdin);
freopen("algsort.out","w",stdout);
scanf("%d",&a);
for (b = 0; b < a; b++) scanf("%d",v + b);
sort(b, b + a, cmp);
for (b = 0; b < a; b++) printf("%d ",v[b]);

return 0;
}