if think from the field graph structure
this is a test:
1 0 0
0 1 1
1 0 1
#include<stdio.h>
int s=0,n=3;
void fy(int a[],int k){
s+=a[k];
if(k<n-1)fy(a,k+1);
}
void f(int a[3][3],int i){
fy(a[i],0);
if(i<n-1)f(a,i+1);
}
int main(){
int a[3][3]={
{1,0,0},
{0,1,1},
{1,0,1}};
f(a,0);
printf("%d",s);
}