Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. static int det(int[][] a)
  2. { if(a.length == 2)
  3. {
  4. return (a[0][0]*a[1][1])-(a[0][1]*a[1][0]);
  5. }
  6.  
  7. int det = 0;
  8. for(int i = 0; i<a.length; i++)
  9. {
  10. det += a[0][i]*det(del(a,0,i));
  11. }
  12.  
  13. return det;
  14. }
  15.  
  16.  
  17. static int[][] del(int[][]a, int i, int j)
  18. {
  19. int[][] n = new int[a.length-1][a.length-1];
  20. for(int f = 0; f<a.length-1; f++)
  21. for(int g = 0; g<a.length-1; g++)
  22. {
  23. {
  24. n[f][g] =
  25. }
  26. }
  27.  
  28.  
  29. return n;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement