Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 22nd, 2013  |  syntax: None  |  size: 0.38 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Matriz 1 de (m x p)
  2. Matriz 2 de (p x n)
  3. Matriz resultado de (m x n)
  4.  
  5. //Definicion de dimensiones
  6. m, p, n = 4;
  7. //Definicion de matrices
  8. m1[m, p];
  9. m2[p, n];
  10. r[m, n]; //Acordarse de inicializarla toda en 0, sino no anda
  11.  
  12. for (int i=0; i<m; i++){
  13.     for (int j=0; j<n; j++){
  14.         for (int k=0; k<p; k++){
  15.                 r[i, j] = r[i, j] + (m1[i, k] * m2[k, j]);
  16.         }    
  17.     }
  18. }
clone this paste RAW Paste Data