Language: C++

const int GETA = 2048;
int n, mxx, mnx, mxy, mny;
char flag[4096][4096];

inline void rec(int y, int x, int p){
	queue<pi> q;
	q.push(mp(y, x));
	flag[y][x] = p;
	while(!q.empty()){
		y = q.front().first; x = q.front().second;
		q.pop();
		
		rep(d, 4){
			const int dy[] = {-1, 0, 1, 0}, dx[] = {0, -1, 0, 1};
			int ny = y + dy[d], nx = x + dx[d];
			if(ny < mnx || ny >= mxx || nx < mny || nx >= mxy || flag[ny][nx]) continue;
			flag[ny][nx] = p;
			q.push(mp(ny, nx));
		}
	}
}
inline void draw(const P &a, const P &b, int rot){
	int x = a.real(), y = a.imag(), X = b.real(), Y = b.imag();
	int dx = X - x, dy = Y - y, mod = 0;
	vector<pi> v;
	for(; x < X; x++){
		v.pb(mp(x, y));
		mod += dy;
		while(mod > dx){
			mod -= dx;
			v.pb(mp(x, ++y));
		}
		if(mod == dx) mod -= dx, y++;
	}
	rep(i, v.size()){
		int x = v[i].first, y = v[i].second;
		rep(it, rot){
			swap(x, y);
			x *= -1;
		}
		const int dx[] = {0, -1, -1, 0}, dy[] = {0, 0, -1, -1};
		flag[x + dx[rot] + GETA][y + dy[rot] + GETA] = 1;
	}
}
inline void draw(P a, P b){
	rep(i, 4){
		if(a.real() < b.real() && a.imag() <= b.imag()){
			draw(a, b, i);
			return;
		}
		a *= P(0, -1);
		b *= P(0, -1);
	}
}
double area2(const G& g) {
  double A = 0;
  for (int i = 0; i < g.size(); ++i) 
    A += cross(curr(g, i), next(g, i));
  return A;
}

int main(){
	while(cin >> n, n){
		G g(n);
		int ans = 0;
		mxx = mxy = -inf; mnx = mny = inf;
		rep(i, n){
			cin >> g[i].real() >> g[i].imag();
			mxx = max((int)g[i].real(), mxx); mnx = min((int)g[i].real(), mnx);
			mxy = max((int)g[i].imag(), mxy); mny = min((int)g[i].imag(), mny);
		}
		mxx += 20 + GETA; mnx += -20 + GETA;
		mxy += 20 + GETA; mny += -20 + GETA;
		if(area2(g) < 0) reverse(all(g));
		
		rep(i, n) draw(g[i], g[(i + 1) % n]);
		for(int i = mnx; i < mxx; i++) for(int j = mny; j < mxy; j++) if(!flag[i][j]){
			rec(i, j, contains(g, P(i - GETA + 0.5, j - GETA + 0.5)) ? 1 : -1);
		}
		for(int i = mnx; i < mxx; i++) for(int j = mny; j < mxy; j++) if(flag[i][j] > 0) ans++;
		cout << ans << endl;
		
		for(int i = mnx; i < mxx; i++) for(int j = mny; j < mxy; j++) flag[i][j] = 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void rec(int, int, int)':
a.cc:6:9: error: 'queue' was not declared in this scope
    6 |         queue<pi> q;
      |         ^~~~~
a.cc:6:15: error: 'pi' was not declared in this scope; did you mean 'p'?
    6 |         queue<pi> q;
      |               ^~
      |               p
a.cc:6:19: error: 'q' was not declared in this scope
    6 |         queue<pi> q;
      |                   ^
a.cc:7:16: error: 'mp' was not declared in this scope; did you mean 'p'?
    7 |         q.push(mp(y, x));
      |                ^~
      |                p
a.cc:13:21: error: 'd' was not declared in this scope
   13 |                 rep(d, 4){
      |                     ^
a.cc:13:17: error: 'rep' was not declared in this scope; did you mean 'rec'?
   13 |                 rep(d, 4){
      |                 ^~~
      |                 rec
a.cc: At global scope:
a.cc:22:24: error: 'P' does not name a type
   22 | inline void draw(const P &a, const P &b, int rot){
      |                        ^
a.cc:22:36: error: 'P' does not name a type
   22 | inline void draw(const P &a, const P &b, int rot){
      |                                    ^
a.cc: In function 'void draw(const int&, const int&, int)':
a.cc:23:19: error: request for member 'real' in 'a', which is of non-class type 'const int'
   23 |         int x = a.real(), y = a.imag(), X = b.real(), Y = b.imag();
      |                   ^~~~
a.cc:24:18: error: 'X' was not declared in this scope
   24 |         int dx = X - x, dy = Y - y, mod = 0;
      |                  ^
a.cc:25:9: error: 'vector' was not declared in this scope
   25 |         vector<pi> v;
      |         ^~~~~~
a.cc:25:16: error: 'pi' was not declared in this scope
   25 |         vector<pi> v;
      |                ^~
a.cc:25:20: error: 'v' was not declared in this scope
   25 |         vector<pi> v;
      |                    ^
a.cc:27:28: error: 'y' was not declared in this scope
   27 |                 v.pb(mp(x, y));
      |                            ^
a.cc:27:22: error: 'mp' was not declared in this scope
   27 |                 v.pb(mp(x, y));
      |                      ^~
a.cc:28:17: error: 'mod' was not declared in this scope
   28 |                 mod += dy;
      |                 ^~~
a.cc:28:24: error: 'dy' was not declared in this scope; did you mean 'dx'?
   28 |                 mod += dy;
      |                        ^~
      |                        dx
a.cc:35:13: error: 'i' was not declared in this scope
   35 |         rep(i, v.size()){
      |             ^
a.cc:35:9: error: 'rep' was not declared in this scope; did you mean 'rec'?
   35 |         rep(i, v.size()){
      |         ^~~
      |         rec
a.cc: At global scope:
a.cc:45:13: error: variable or field 'draw' declared void
   45 | inline void draw(P a, P b){
      |             ^~~~
a.cc:45:18: error: 'P' was not declared in this scope
   45 | inline void draw(P a, P b){
      |                  ^
a.cc:45:23: error: 'P' was not declared in this scope
   45 | inline void draw(P a, P b){
      |                       ^
a.cc:55:20: error: 'G' does not name a type
   55 | double area2(const G& g) {
      |                    ^
a.cc: In function 'double area2(const int&)':
a.cc:57:25: error: request for member 'size' in 'g', which is of non-class type 'const int'
   57 |   for (int i = 0; i < g.size(); ++i)
      |                         ^~~~
a.cc:58:16: error: 'curr' was not declared in this scope
   58 |     A += cross(curr(g, i), next(g, i));
      |                ^~~~
a.cc:58:28: error: 'next' was not declared in this scope
   58 |     A += cross(curr(g, i), next(g, i));
      |                            ^~~~
a.cc:58:10: error: 'cross' was not declared in this scope
   58 |     A += cross(curr(g, i), next(g, i));
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:63:15: error: 'cin' was not declared in this scope
   63 |         while(cin >> n, n){
      |               ^~~
a.cc:64:17: error: 'G' was not declared in this scope
   64 |                 G g(n);
      |                 ^
a.cc:66:30: error: 'inf' was not declared in this scope; did you mean 'int'?
   66 |                 mxx = mxy = -inf; mnx = mny = inf;
      |                              ^~~
      |                              int
a.cc:67:21: error: 'i' was not declared in this scope
   67 |                 rep(i, n){
      |                     ^
a.cc:67:17: error: 'rep' was not declared in this scope; did you mean 'rec'?
   67 |                 rep(i, n){
      |                 ^~~
      |                 rec
a.cc:74:26: error: 'g' was not declared in this scope
   74 |                 if(area2(g) < 0) reverse(all(g));
      |                          ^
a.cc:74:42: error: 'all' was not declared in this scope
   74 |                 if(area2(g) < 0) reverse(all(g));
      |                                          ^~~
a.cc:74:34: error: 'reverse' was not declared in this scope
   74 |                 if(area2(g) < 0) reverse(all(g));
      |                                  ^~~~~~~
a.cc:78:44: error: 'g' was not declared in this scope
   78 |                         rec(i, j, contains(g, P(i - GETA + 0.5, j - GETA + 0.5)) ? 1 : -1);
      |                                            ^
a.cc:78:47: error: 'P' was not declared in this scope
   78 |                         rec(i, j, contains(g, P(i - GETA + 0.5, j - GETA + 0.5)) ? 1 : -1);
      |                                               ^
a.cc:78:35: error: 'contains' was not declared in this scope
   78 |                         rec(i, j, contains(g, P(i - GETA + 0.5, j - GETA + 0.5)) ? 1 : -1);
      |                                   ^~~~~~~~
a.cc:81:17: error: 'cout' was not declared in this scope
   81 |                 cout << ans << endl;
      |                 ^~~~
a.cc:81:32: error: 'endl' was not declared in this scope
   81 |                 cout << ans << endl;
      |                                ^~~~