//Dev-C++ 5.11
#include
using namespace std;
int main(void)
{const int n=3;
const int m=3;
int ma[n][m];
int c;
cout<<"First matrix"<<endl;<br> for(int i=0;i {for(int j=0;j {ma[i][j]=i+j;
cout<<ma[i][j]<<" ";}<br> cout<<endl;}<br> for(int i=0;i for(int j=0;j {c=ma[i][j];
ma[i][j]=ma[n-i-1][j];
ma[n-1-i][j]=c;}}
cout<<"Final matrix"<<endl;<br> for(int i=0;i {for(int j=0;j cout<<ma[i][j]<<" ";<br> cout<<endl;}<br> return 0;
}
Пример работы программы(n=3,m=3):
First matrix:
0 1 2
1 2 3
2 3 4
Final matrix:
2 3 4
1 2 3
0 1 2