//Dev-C++ 4.9.9.2
#include
#include
using namespace std;
#define n 3
#define m 4
int main(){
srand(time(NULL));
int ma[n][m];
int arsub[n];
int max=-1;
cout<<"Matrix:"<<endl;<br> for(int i=0;i for(int j=0;j ma[i][j]=rand()%50;
cout<<ma[i][j]<<' ';<br> if(ma[i][j]>max)max=ma[i][j];}
cout<<endl;<br> arsub[i]=max;
max=-1;}
for(int i=0;i for(int j=i+1;j if(arsub[j]>arsub[i]){
for(int z=0;z swap(ma[i][z],ma[j][z]);
swap(arsub[j],arsub[i]);}
cout<<"Final matrix:"<<endl;<br> for(int i=0;i for(int j=0;j cout<<ma[i][j]<<' ';<br> cout<<endl;}<br> cin.get();
cin.get();
return 0;
}