I am pretty new to programming, so please ignore the inefficiency of the program.
This is a program to arrange numbers in increasing order, and it runs perfectly in code::blocks, but submitting this as an answer to one of the practice problems gives a segmentation error.
Language is C++.
#include<cstdio>
signed int a[100000];
int main()
{
int t=0,num=0;
scanf("%d%",&t);
for(int i=0;i<100000;++i)
{
a[i]=-1;
}
for(int j=0;j<t;++j)
{
scanf("%d",&num);
a[num]++;
}
for(int k=0;k<100000;++k)
{
if(a[k]!=-1)
{
for(int l=0;l<=a[k];++l)
{
printf("%d\n",k);
}
}
}
return 0;
}