Skip to main content
adicionou 6 caracteres ao conteúdo
Fonte Link
hkotsubo
  • 66,9mil
  • 25
  • 87
  • 170

Tenho as seguintes matrizes de 100 elementos:

Tenho as seguintes matrizes de 100 elementos:
int [][]matriz1 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,1,1,1,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0}};


int [][]matriz2 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,1,1,1,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0}};

Como passo a matriz1matriz1 e matriz2matriz2 para um vector? Na posição 0 do vector fica a matriz1matriz1 e na posição 1 fica a matriz2matriz2.

Tenho as seguintes matrizes de 100 elementos:
int [][]matriz1 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,1,1,1,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0}};


int [][]matriz2 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,1,1,1,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0}};

Como passo a matriz1 e matriz2 para um vector? Na posição 0 do vector fica a matriz1 e na posição 1 fica a matriz2.

Tenho as seguintes matrizes de 100 elementos:

int [][]matriz1 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,1,1,1,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0}};


int [][]matriz2 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,1,1,1,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0}};

Como passo a matriz1 e matriz2 para um vector? Na posição 0 do vector fica a matriz1 e na posição 1 fica a matriz2.

Fonte Link
manuel
  • 71
  • 2
  • 9

Como colocar sucessivas matrizes em vector

Tenho as seguintes matrizes de 100 elementos:
int [][]matriz1 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,0,0,1,0,0,0},
                          {0,0,0,0,1,1,1,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0}};


int [][]matriz2 = {       {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,1,1,1,0,0,0,0},
                          {0,0,0,0,1,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0},
                          {0,0,0,0,0,0,0,0,0,0}};

Como passo a matriz1 e matriz2 para um vector? Na posição 0 do vector fica a matriz1 e na posição 1 fica a matriz2.