fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int[,] matrizA = { { 3, 4, 1 }, { -2, -3, 0 } };
  8. int[,] matrizB = { { 5, 0, 1 }, { 3, 2, -5 } };
  9. int[,] matrizSuma = new int[2, 3];
  10. for (int i = 0; i < 2; i++)
  11. {
  12. for (int j = 0; j < 3; j++)
  13. {
  14. matrizSuma[i, j] = matrizA[i, j] + matrizB[i, j];
  15. }
  16. }
  17. int numeroMenor = matrizSuma[0, 0];
  18. for (int i = 0; i < 2; i++)
  19. {
  20. for (int j = 0; j < 3; j++)
  21. {
  22. if (matrizSuma[i, j] < numeroMenor)
  23. {
  24. numeroMenor = matrizSuma[i, j];
  25. }
  26. }
  27. }
  28. Console.WriteLine("El número menor de la matriz suma es: " + numeroMenor);
  29. }
  30. }
Success #stdin #stdout 0.05s 30160KB
stdin
Standard input is empty
stdout
El número menor de la matriz suma es: -5