21.01.2008, 17:55
общий
это ответ
Здравствуйте, Razum89!
Решение смотрите в приложении
Приложение:
#include <cstdlib>#include <iostream>using namespace std;int main(){ int m, n, max=0, num=0, s; int **a; bool f; cin>>m; a=(int**) new int* [m]; for(int i=0; i<m; ++i) a[i]=new int [m]; srand(time(NULL)); for(int i=0; i<m; ++i) for(int j=0; j<m; j++) a[i][j]=rand()%100; for(int i=0; i<m; ++i){ for(int j=0; j<m; j++){ cout<<a[i][j]<<"\t"; } cout<<endl; } cout<<endl; for(int i=0; i<m/2; ++i){ for(int j=0; j<m; j++){ n=a[i][j]; a[i][j]=a[m-i-1][m-j-1]; a[m-i-1][m-j-1]=n; }} cout<<endl; for(int i=0; i<m; ++i){ for(int j=0; j<m; j++){ cout<<a[i][j]<<"\t"; } cout<<endl; } cout<<endl; system("PAUSE"); return 0;}