Cod sursa(job #293729)

Utilizator gabitzish1Gabriel Bitis gabitzish1 Data 2 aprilie 2009 00:51:23
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda infoexpert Marime 0.38 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(v, v + a, cmp);
for (b = 0; b < a; b++) printf("%d ",v[b]);

return 0;
}