
#include <iostream>
#include <math.h>
#include <time.h>
#include<iomanip>
#include<array>
#include <algorithm>

using namespace std;
const int AS = 6;
void FillingRandomly(int (*)[AS]);
void printing(int (*)[AS]);


int c;

int main()

{
	int funny = 0;
	int timpa = 0;
	int counter = 0;
	int Array[AS][AS];
	srand(time(0));


	FillingRandomly(Array);	
	

	cout << "The unsorted array is" << endl << endl;

	printing(Array);

	cout << "The sorted array is" << endl << endl;

	printing(Array);

	

		

	
	
	system("PAUSE");


	return 0;

}

void FillingRandomly(int *Array)
{for(int i=0;i<AS;i++)
{for (int j=0;j<AS;j++)

*Array[i][j]=rand()%87 +12;

		}
}

void printing(int *Array)
{
	for(int i=0;i<AS;i++)
	{for (int j=0;j<AS;j++)
	{int counter = 0;

	cout<<*Array[i][j];

			if (*Array[i][j]%AS == 0)
				cout << endl << endl;
	}	
}