Bubble sort help needed : I am trying to sort a 2d Array using bubble sort algorithm and i am constantly failing. What i need to do is to create a 2d array of random numbers 10-90 and find out the largest elements from each row after that sort that list of largest elements in ascending order using Bubble sort. I have done until finding the largest element from each row but i can not sort that list. The list of largest elements is saved in a variable called max. How can i sort that list using bubble sort. 
Any help will be appreciated. 

Below is what I have tried so far:

//Write a program that fills the values of the two dimensional array A[N,M] with the random numbers from 10 to 90 and determines the largest value in each row. 
//Rows largest element values arrange in ascending order, using the "Bubble" sort algorithm. N and M input by the user.


    int i,j,rows, columns, temp, swapped;
    cout<<"How many rows? ";
    cin>> rows;
	cout<< "how many columns? ";
	cin>>columns;
	
	int array[rows][columns];
	
	for(i = 0; i<rows; i++){
		for(j=0; j<columns; j++){
			array[i][j] = rand()%90+10;
		}cout<<endl;
	}
	
	for(i = 0; i<rows; i++){
		for(j=0; j<columns; j++){
			cout<<array[i][j]<<" ";
		}
		cout<<endl;
	}
	for(i=0;i<rows;i++){
		
	int	max=array[i][0];
	
		for(j=0;j<columns;j++){
			
			if(max  <  array[i][j]){
			
			max = array[i][j];
		}
		
		}
			cout<<"Largest element in row" << i << "is: "<< max << endl;
	}
	while(1){
		swapped=0;
		
		
		for(i=0; i<rows-1;rows++){
			
	for(j=0; j<columns; j++){
		if(max > max+[1]){
			temp = max;
			max = max+[1];
			max+[1] = temp;
			swapped=1;
		}
	}
		}
		if(swapped==0){
			break;
		}
	}
	
		for(i=0; i<rows;rows++){
	for(j=0; j<columns; j++){
		cout<< max << endl;	
	}
}

	return 0 ;
}