Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. int** composition(int** a, int** b, int n)
  2. {
  3. int** c = new int* [n];
  4. for (int i = 0; i < n; i++)
  5. c[i] = new int[n];
  6. for (int i = 0; i < n; i++)
  7. {
  8. for (int j = 0; j < n; j++)
  9. {
  10. c[i][j] = 0;
  11. for (int h = 0; h < n; h++)
  12. c[i][j] += a[i][h] * b[h][j];
  13. }
  14. }
  15. return c;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement