Cod sursa(job #1344173)
Utilizator | Data | 16 februarie 2015 14:58:38 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <fstream>
using namespace std;
ifstream in ("algsort.in");
ofstream out ("algsort.out");
int main()
{
unsigned long long i,nn,nr=0,mm,c=0,k,x,j;
int a[10000000],n;
in>>n;
for (j=1;j<=n;j++)
{
in>>x;
a[x]++;
}
for(i=1; i<9000000; i++)
while (a[i]>0)
{
out<<i<<" ";
a[i]--;
}
return 0;
}