fork download
  1. using System.Linq;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. var linhas = 3;
  6. var colunas = 3;
  7. var matriz = new int[linhas, colunas];
  8. for (int i = 0, count = 0; i < linhas; i++) for (int j = 0; j < colunas; j++) matriz[i, j] = count++;
  9. var vetor = matriz.OfType<int>().ToArray();
  10. foreach (var elem in vetor)
  11. System.Console.WriteLine(elem);
  12. }
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/431651/101
Success #stdin #stdout 0.02s 16996KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6
7
8