#include <iostream>
#include<cstdlib>
#include<ctime>
#define FILA 3
#define COLUMNA 7
using namespace std;
void rellenarMatriz(int matriz[][COLUMNA]){//no es necesario especificar el tamano de la fila
srand(time(0));
for(int i=0;i<FILA;i++){ for(int j=0;j<COLUMNA;j++){ int nAleatorio=rand()%100; //numero entre 0 y 100
matriz[i][j]=nAleatorio;
}
}
}
void imprimirMatriz(int matriz[][COLUMNA]){ for(int i=0;i<FILA;i++){ for(int j=0;j<COLUMNA;j++){ cout<<matriz[i][j]<<" ";
}
cout<<endl;
}
}
void restarColumnas(int matriz[][COLUMNA]){const int COLUMNA_DOS=1,COLUMNA_TRES=2,COLUMNA_CUATRO=3;
for(int i=0;i<FILA;i++){ for(int j=0;j<COLUMNA;j++){ if(j==COLUMNA_DOS){ matriz[i][COLUMNA_CUATRO]=matriz[i][COLUMNA_DOS]-matriz[i][COLUMNA_TRES];
}
}
}
}
int main()
{ int matriz[FILA][COLUMNA];
rellenarMatriz(matriz);
imprimirMatriz(matriz);
cout<<endl;
restarColumnas(matriz);
imprimirMatriz(matriz);
return 0;
}