#include<iostream>
using namespace std;
void selectionsort()
{ int i,j,key,a[100],n;
cout<<"enter the value of n";
cin>>n;
cout<<endl<<"enter the array elements";
for(i=0;i<n;i++)
{
cin>>a[i];
}
for(i=1;i<n;i++)
{
key=a[i];
j=i-1;
while(j>=0 && a[j]>key)
{
a[j+1]=a[j];
j=j-1;
}
a[i+1]=key;
}
for(i=0;i<n;i++)
{
cout<<a[i];
}
}
int main()
{
selectionsort();
}