#include<iostream>
using namespace std;
void sort(int arr[],int n)
{
for(int i=1;i<n;i++)
{
int t = arr[i];
int j =i;
for(;j>0&&arr[j-1]>t;j--)
{
arr[j] = arr[j-1];
}
arr[j] = t;
}
}
void main()
{
int n;
cout<<"input n:";
cin>>n;
int *arr = new int[n];
cout<<"input number:";
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
sort(arr,n);
cout<<"after sort:";
for(int i=0;i<n;i++)
{
cout<<arr[i]<<",";
}
}