// Izabel

void soma(int **m1,int **m2,int **m3, int x, int y){

	int i,j;

	for ( i=0; i<x; i++ ){

      for ( j=0; j<y; j++ ){

    m3[i][j]= m2[i][j]+m1[i][j];

     }
   	}
}

int main (void)
{
  int i,j;
  int **m1;
  int **m2;
  int **m3;
  int l,c;

  printf ("digite o numero de linha: ");
  scanf ("%d", &l);
  printf ("digite o numero de colunas: ");
  scanf ("%d", &c);

  m1 = (int**) malloc(l*sizeof(int *));
  m2 = (int**) malloc(l*sizeof(int *));
  m3 = (int**) malloc(l*sizeof(int *));

  for (i=0; i<l; i++){
  	m1[i] = (int*) malloc (c* sizeof(int ));
  }

    for (i=0; i<l; i++){
  	m2[i] = (int*) malloc (c* sizeof(int ));
  }

  for (i=0; i<l; i++){
  	m3[i] = (int*) malloc (c* sizeof(int ));
  }


  for ( i=0; i<l; i++ )
    for ( j=0; j<c; j++ )
    {
      printf ("\nElemento[%d][%d] da matriz 1 = ", i, j);
      scanf ("%d", &m1[i][j]);
    }


  for ( i=0; i<l; i++ )
    for ( j=0; j<c; j++ )
    {
      printf ("\nElemento[%d][%d] da matriz 2 = ", i, j);
      scanf ("%d", &m2[i][j]);
    }

    soma(m1, m2, m3, l, c);

 for ( i=0; i<l; i++ ){

    printf ("|");
    for ( j=0; j<c; j++ )
    {
      printf ("%d ",m3[i][j]);

    }
    printf ("|\n");

 }

return 0;
}
