Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. //void MatrizIndentidad()
  7. //{
  8. //
  9. // int Matriz_I[12][12];
  10. //
  11. // for (int fila = 0; fila < 12; fila++)
  12. // {
  13. // for (int columna = 0; columna < 12; columna++)
  14. // {
  15. // if (fila == columna)
  16. // Matriz_I[fila][columna] = 1;
  17. // else
  18. // Matriz_I[fila][columna] = 0;
  19. //
  20. // cout << Matriz_I[fila][columna];
  21. // }
  22. // cout << endl;
  23. // }
  24. //}
  25.  
  26. //void MatrizA( int m[][12], int _n, int _n2)
  27. //{
  28. //
  29. // srand(time(NULL));
  30. // int Matriz_A[12][12];
  31. //
  32. // for (int fila = 0; fila < _n; fila++)
  33. // {
  34. // for (int columna = 0; columna < 12; columna++)
  35. // {
  36. // Matriz_A[fila][columna] = rand() % 10 + 1;
  37. //
  38. // cout << Matriz_A[fila][columna] << " ";
  39. // }
  40. //
  41. // cout << endl;
  42. // }
  43. //
  44. //}
  45.  
  46. //void MatrizB()
  47. //{
  48. // srand(time(NULL));
  49. // int Matriz_B[12];
  50. //
  51. // for (int fila = 0; fila < 12; fila++)
  52. // {
  53. // Matriz_B[fila] = rand() % 50 + 10;
  54. //
  55. // cout << Matriz_B[fila] << endl;
  56. // }
  57. //}
  58.  
  59.  
  60.  
  61.  
  62. void Inversa_M(int mA[][12], int _n, int _n2, int mI[12], int _n3)
  63. {
  64. // A x I = A^-1;
  65.  
  66.  
  67. }
  68.  
  69.  
  70.  
  71. void main()
  72. {
  73. srand(time(NULL));
  74. const int Nfilas = 12;
  75. const int NCol = 12;
  76.  
  77. int n;
  78. do {
  79. cout << "Ingresa el tama" << char(164) << "o de las matrices: ";
  80. cin >> n;
  81.  
  82. } while (n < 8 || n > 12);
  83.  
  84.  
  85.  
  86. int Matriz_A[12][12];
  87. for (int fila = 0; fila < n; fila++)
  88. {
  89. for (int columna = 0; columna < n; columna++)
  90. {
  91. Matriz_A[fila][columna] = rand() % 10 + 1;
  92.  
  93. cout << Matriz_A[fila][columna] << " ";
  94. }
  95.  
  96. cout << endl;
  97. }
  98.  
  99.  
  100. int Matriz_I[12][12];
  101. for (int fila = 0; fila < n; fila++)
  102. {
  103. for (int columna = 0; columna < n; columna++)
  104. {
  105. if (fila == columna)
  106. Matriz_I[fila][columna] = 1;
  107. else
  108. Matriz_I[fila][columna] = 0;
  109.  
  110. cout << Matriz_I[fila][columna];
  111. }
  112. cout << endl;
  113. }
  114.  
  115.  
  116. int Matriz_B[12];
  117. for (int fila = 0; fila < n; fila++)
  118. {
  119. Matriz_B[fila] = rand() % 50 + 10;
  120.  
  121. cout << Matriz_B[fila] << endl;
  122. }
  123.  
  124.  
  125. _getch();
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement