#include
#define N 100
void main()
{
int a[N],b[N];
int i,j,k,m,n,pos;
printf("Enter n!(not more than 100):");
scanf("%d",&n);
printf("Enter integers!:\n");
for(i=0;iscanf("%d",&a[i]);
for(i=m=0;i{
for(k=0;k if(a[k]==a[i]) break;
if(k != i) continue;//
for(k=i+1; kif(a[k]==a[i]) break;//
if(k == n) //
{
for(j=0;jb[j];j++) ;//
m++;//
pos=j;
for(j=m-2;j>=pos;j--)
b[j+1]=b[j];
b[pos]=a[i];//
}
}
printf("After sorting:\n");
for(i=0;iprintf("%4d",b[i]);
printf("\n");
}