Language: C++

#include <iostream>
#include <vector>

class Road{
private:
	int col,row,close_num, goal_num;
	std::vector<int> close_x;
	std::vector<int> close_y;
	
public:
	Road(int a, int b, int n);
	~Road() = default;
	void inPoint();
	void go_road(int now_x,int now_y);
	int isGo(int x, int y);
	void showGoal();
};

int main(){
	int a,b;

	while(std::cin >> a >> b){
		if(a == 0 && b == 0) break;
		
		int n;
		std::cin >> n;
		
		Road road(a,b,n);
		road.inPoint();
		road.go_road(1,1);
		road.showGoal();
	}
	
	return 0;
}

Road(int a, int b, int n){
	col = a; //column
	row = b; //row
	close_num = n; //close count
	close_x.resize(n);
	close_y.resize(n);
	goal_num = 0; //goal count
}

void inPoint(){
	for(int i=0; i<close_num; ++i){
		std::cin >> close_x[i] >> close_y[i];
	}
}

void go_road(int now_x,int now_y){
	if(now_x == col && now_y == row){
		++goal_num;
		return;
	}

	if(now_x+1 <= col)
		if(isGo(now_x+1, now_y)) go_road(now_x+1, now_y);
	
	if(now_y+1 <= row)
		if(isGo(now_x, now_y+1)) go_road(now_x, now_y+1);
}

int isGo(int x, int y){
	for(int i=0; i<close_num; ++i){
		if(x == close_x[i] && y == close_y[i]) return 0;
	}
	return 1;
}

void showGoal(){ std::cout << goal_num << std::endl; }

Compiler output:
a.cc:37:1: error: ISO C++ forbids declaration of 'Road' with no type [-fpermissive]
   37 | Road(int a, int b, int n){
      | ^~~~
a.cc: In function 'int Road(int, int, int)':
a.cc:38:9: error: 'col' was not declared in this scope
   38 |         col = a; //column
      |         ^~~
a.cc:39:9: error: 'row' was not declared in this scope
   39 |         row = b; //row
      |         ^~~
a.cc:40:9: error: 'close_num' was not declared in this scope
   40 |         close_num = n; //close count
      |         ^~~~~~~~~
a.cc:41:9: error: 'close_x' was not declared in this scope
   41 |         close_x.resize(n);
      |         ^~~~~~~
a.cc:42:9: error: 'close_y' was not declared in this scope
   42 |         close_y.resize(n);
      |         ^~~~~~~
a.cc:43:9: error: 'goal_num' was not declared in this scope
   43 |         goal_num = 0; //goal count
      |         ^~~~~~~~
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
a.cc: In function 'void inPoint()':
a.cc:47:24: error: 'close_num' was not declared in this scope
   47 |         for(int i=0; i<close_num; ++i){
      |                        ^~~~~~~~~
a.cc:48:29: error: 'close_x' was not declared in this scope
   48 |                 std::cin >> close_x[i] >> close_y[i];
      |                             ^~~~~~~
a.cc:48:43: error: 'close_y' was not declared in this scope
   48 |                 std::cin >> close_x[i] >> close_y[i];
      |                                           ^~~~~~~
a.cc: In function 'void go_road(int, int)':
a.cc:53:21: error: 'col' was not declared in this scope
   53 |         if(now_x == col && now_y == row){
      |                     ^~~
a.cc:53:37: error: 'row' was not declared in this scope
   53 |         if(now_x == col && now_y == row){
      |                                     ^~~
a.cc:54:19: error: 'goal_num' was not declared in this scope
   54 |                 ++goal_num;
      |                   ^~~~~~~~
a.cc:58:23: error: 'col' was not declared in this scope
   58 |         if(now_x+1 <= col)
      |                       ^~~
a.cc:59:20: error: 'isGo' was not declared in this scope
   59 |                 if(isGo(now_x+1, now_y)) go_road(now_x+1, now_y);
      |                    ^~~~
a.cc:61:23: error: 'row' was not declared in this scope
   61 |         if(now_y+1 <= row)
      |                       ^~~
a.cc:62:20: error: 'isGo' was not declared in this scope
   62 |                 if(isGo(now_x, now_y+1)) go_road(now_x, now_y+1);
      |                    ^~~~
a.cc: In function 'int isGo(int, int)':
a.cc:66:24: error: 'close_num' was not declared in this scope
   66 |         for(int i=0; i<close_num; ++i){
      |                        ^~~~~~~~~
a.cc:67:25: error: 'close_x' was not declared in this scope
   67 |                 if(x == close_x[i] && y == close_y[i]) return 0;
      |                         ^~~~~~~
a.cc:67:44: error: 'close_y' was not declared in this scope
   67 |                 if(x == close_x[i] && y == close_y[i]) return 0;
      |                                            ^~~~~~~
a.cc: In function 'void showGoal()':
a.cc:72:31: error: 'goal_num' was not declared in this scope
   72 | void showGoal(){ std::cout << goal_num << std::endl; }
      |                               ^~~~~~~~