#include <iostream.h> #include <stdlib.h> #include <time.h> #define WH 10 #define HH 5 int matrix[WH][HH],nmatrix[WH-1][HH-1]; void main() { srand(unsigned(time(0))); int i,j,k,n,ni,nj; for(i=0;i<WH;i++) for(j=0;j<HH;j++) matrix[i][j]=rand()%100; cout << "VVedi K(ot 1 do " << WH << ") i N(ot 1 do " << HH << "):"; cin >> k >> n; ni=nj=i=j=0; while (i<WH) { if(i!=k-1) { nj=j=0; while(j<HH) { if(j!=n-1) { nmatrix[ni][nj]=matrix[i][j]; nj++; }; j++; }; ni++; }; i++; }; //vivod for(i=0;i<WH;i++) { for(j=0;j<HH;j++) { cout << matrix[i][j] << " "; }; cout << endl; } cout << endl; for(i=0;i<WH-1;i++) { for(j=0;j<HH-1;j++) { cout << nmatrix[i][j] << " "; }; cout << endl; } return; } |