#include<iostream> using namespace std;

template<typename T>

class sort

{

private:

T i,temp;

public:

sort(T n,T a[]);

};

template<typename T> sort<T>::sort(T n,T a[])

{

for(i=0;i<n;i++)

{

if(a[i]>a[i+1])

{

temp=a[i];

a[i]=a[i+1];

a[i+1]=temp;

}

}

cout<<"After sorting the elements are:";

for(i=0;i<n;i++)

{

cout<<a[i];

}

}

int main()

{

int n,i,a[n];

cout<<"Enter the number of elements to be sorted:"<<endl;

cin>>n;

cout<<"Enter the elements one by one:"<<endl;

for(i=0;i<n;i++)

{

cin>>a[i];

}

sort<int>ob(n,a);

return 0;

}