, , - ,
1 2
3 4
10, 1.4 + 2.3 = 10 ,
1 2 3
4 5 6
7 8 9
450, 1.5.9 + 1.6.8 + 2.4.9 + 2.6.7 + 3.4.8 + 3.5.7 = 450.
:

Code:
#include <iostream>
using namespace std;
 
void det(int arr[][20] , bool col[20] , int n , int &sum , int i , int counter, int tmp )
{
if(counter == n) 
{
sum+=tmp;
return;
}
for(int j = 0 ; j<= n-1 ; j++)
if(col[j])
{
col[j] = 0 ;
 
 
det(arr, col , n , sum , i+1 ,counter + 1,tmp*arr[i][j]);
 
col[j] = 1;
}
 
}
 
int main()
{
int arr[20][20];
cout << "Enter n : ";
int n ;  cin >> n;
 
cout << "Enter the matrix: " << endl ;
for(int i = 0 ; i <= n-1 ; i ++)
for(int j = 0 ; j <= n-1 ; j++)
cin >> arr[i][j];
 
bool col[20]; 
for(int i = 0 ; i <= n-1 ; i ++ )
col[i] = 1;
 
int sum = 0;
 
det(arr , col , n , sum , 0 , 0 ,  1);
 
cout << sum << endl;
 
cin.sync();
cin.get();
return 0 ;
}
: col[j] , ( , ). tmp -
1 2
3 4 1.4 , 2.3 . , " " sum. Sum .Counter " " . i ( , , ..). counter i ? .
( , void ... ) , counter ( i) . , ( ). , / /.
, . , , . , C++ , , .
, .