Language: C

#include <stdio.h>

int map[10][10];
int m,n;

int chousa(int kx,int ky,int nokori) {
	int x,y;
	int result=0;
	int house=0;
	if(map[kx][ky]==1) {/*今いる家を通ったことにする*/
		map[kx][ky]=0;
		house=1;
	}
	/*左に道順を調査*/
	for(x=kx-1;x>=0;x--) {
		/*家に降りる*/
		if(map[x][ky]==1) {
			result+=chousa(map,x,ky,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[x][ky]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[x][ky]==3)break;
	}
	/*右に道順を調査*/
	for(x=kx+1;x<m;x++) {
		/*家に降りる*/
		if(map[x][ky]==1) {
			result+=chousa(map,x,ky,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[x][ky]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[x][ky]==3)break;
	}
	/*上に道順を調査*/
	for(y=ky-1;y>=0;y--) {
		/*家に降りる*/
		if(map[kx][y]==1) {
			result+=chousa(map,kx,y,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[kx][y]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[kx][y]==3)break;
	}
	/*下に道順を調査*/
	for(y=ky+1;y<n;y++) {
		/*家に降りる*/
		if(map[kx][y]==1) {
			result+=chousa(map,kx,y,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[kx][y]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[kx][y]==3)break;
	}
	if(house)map[kx][ky]=1;/*通った家を元に戻す*/
	return result;
}

int main(void) {
	int x,y;
	int kx,ky;
	int kazu;
	while(1) {
		scanf("%d %d",&m,&n);
		if(m==0 && n==0)break;
		kazu=0;
		/*読み込み*/
		for(y=0;y<n;y++) {
			for(x=0;x<m;x++) {
				scanf("%d",&map[x][y]);
				if(map[x][y]==2) {/*教会*/
					kx=x;
					ky=y;
				} else if(map[x][y]==1)kazu++;/*家*/
			}
		}
		/*計算*/
		printf("%d\n",chousa(kx,ky,kazu));
	}
	return 0;
}

Compiler output:
main.c: In function 'chousa':
main.c:18:40: error: passing argument 1 of 'chousa' makes integer from pointer without a cast [-Wint-conversion]
   18 |                         result+=chousa(map,x,ky,nokori-1,m,n);
      |                                        ^~~
      |                                        |
      |                                        int (*)[10]
main.c:6:16: note: expected 'int' but argument is of type 'int (*)[10]'
    6 | int chousa(int kx,int ky,int nokori) {
      |            ~~~~^~
main.c:18:33: error: too many arguments to function 'chousa'
   18 |                         result+=chousa(map,x,ky,nokori-1,m,n);
      |                                 ^~~~~~
main.c:6:5: note: declared here
    6 | int chousa(int kx,int ky,int nokori) {
      |     ^~~~~~
main.c:33:40: error: passing argument 1 of 'chousa' makes integer from pointer without a cast [-Wint-conversion]
   33 |                         result+=chousa(map,x,ky,nokori-1,m,n);
      |                                        ^~~
      |                                        |
      |                                        int (*)[10]
main.c:6:16: note: expected 'int' but argument is of type 'int (*)[10]'
    6 | int chousa(int kx,int ky,int nokori) {
      |            ~~~~^~
main.c:33:33: error: too many arguments to function 'chousa'
   33 |                         result+=chousa(map,x,ky,nokori-1,m,n);
      |                                 ^~~~~~
main.c:6:5: note: declared here
    6 | int chousa(int kx,int ky,int nokori) {
      |     ^~~~~~
main.c:48:40: error: passing argument 1 of 'chousa' makes integer from pointer without a cast [-Wint-conversion]
   48 |                         result+=chousa(map,kx,y,nokori-1,m,n);
      |                                        ^~~
      |                                        |
      |                                        int (*)[10]
main.c:6:16: note: expected 'int' but argument is of type 'int (*)[10]'
    6 | int chousa(int kx,int ky,int nokori) {
      |            ~~~~^~
main.c:48:33: error: too many arguments to function 'chousa'
   48 |                         result+=chousa(map,kx,y,nokori-1,m,n);
      |                                 ^~~~~~
main.c:6:5: note: declared here
    6 | int chousa(int kx,int ky,int nokori) {
      |     ^~~~~~
main.c:63:40: error: passing argument 1 of 'chousa' makes integer from pointer without a cast [-Wint-conversion]
   63 |                         result+=chousa(map,kx,y,nokori-1,m,n);
      |                                        ^~~
      |                                        |
      |                                        int (*)[10]
main.c:6:16: note: expected 'int' but argument is of type 'int (*)[10]'
    6 | int chousa(int kx,int ky,int nokori) {
      |            ~~~~^~
main.c:63:33: error: too many arguments to function 'chousa'
   63 |                         result+=chousa(map,kx,y,nokori-1,m,n);
      |                                 ^~~~~~
main.c:6:5: note: declared here
    6 | int chousa(int kx,int ky,int nokori) {
      |     ^~~~~~