#include <iostream>
using namespace std;

class class1
{
public:
	int n;
	double* arr = new double[n];
	void get();
	void sort_ascend();
	void display();
};

void class1::get()
{
	cout << "Enter the number of elements in the array: ";
	cin >> n;
	cout << "Enter the elements one by one: ";
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
}

void class1::sort_ascend()
{
	for (int j = 0; j < n - 1; j++)
	{
		for (int k = j + 1; k < n; k++)
		{
			if (arr[j] > arr[k])
			{
				int t;
				t = arr[j];
				arr[j] = arr[k];
				arr[k] = t;
			}
		}
	}
}

void class1::display()
{
	cout << "The array after sorting in ascending order is: {";

	for (int i = 0; i < n; i++)
	{
		cout << arr[i];
		if (i != n - 1)
		{
			cout << ", ";
		}
	}
	cout << "}";
}

int main()
{
	class1 a;
	a.get();
	a.sort_ascend();
	a.display();
}