fork download
  1. public class Program {
  2. public static void Main() {
  3. var linhas = 3;
  4. var colunas = 3;
  5. var matriz = new int[linhas, colunas];
  6. for (int i = 0, count = 0; i < linhas; i++) for (int j = 0; j < colunas; j++) matriz[i, j] = count++;
  7. var vetor = new int[matriz.Length];
  8. for (int i = 0, count = 0; i < linhas; i++) for (int j = 0; j < colunas; j++) vetor[count++] = matriz[i, j];
  9. }
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/431651/101
Success #stdin #stdout 0.01s 13940KB
stdin
Standard input is empty
stdout
Standard output is empty