Cod sursa(job #1344170)
Utilizator | Data | 16 februarie 2015 14:56:10 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.4 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[1000001],n;
in>>n;
for (j=1;j<=n;j++)
{
in>>x;
a[x]++;
}
for(i=1; i<100; i++)
while (a[i]>0)
{
out<<i<<" ";
a[i]--;
}
return 0;
}