func_code_string: #include <bits/stdc++.h>   using namespace std;   const int NMax = 1003;   enum directions { EAST, NORTH };   struct point {     int x, y;   };   point a[NMax];   int n;   int test(int searchDir, point a[], long double x, long double y) {     if (searchDir == NORTH) {       int nr = 0;       for (int i = 1; i <= n; ++i) {         if (a[i].y >= y &&             (((long double)a[i].x >= x && x <= (long double)a[i + 1].x) ||              ((long double)a[i].x <= x && x >= (long double)a[i + 1].x))) {           nr++;         }       }       return (nr & 1);     } else {       int nr = 0;       for (int i = 1; i <= n; ++i) {         if (a[i].x >= x &&             (((long double)a[i].y >= y && y <= (long double)a[i + 1].y) ||              ((long double)a[i].y <= y && y >= (long double)a[i + 1].y))) {           nr++;         }       }       return (nr & 1);     }   }   int main() {     cin >> n;     for (int i = 1; i <= n + 1; ++i) {       cin >> a[i].x >> a[i].y;     }     int ans = 0;     for (int i = 2; i <= n + 1; ++i) {       if (a[i].x == a[i - 1].x) {         if (a[i].y > a[i - 1].y) {           ans += test(EAST, a, a[i].x, a[i].y + 0.5);         } else {           ans += test(EAST, a, a[i].x, a[i].y - 0.5);         }       } else {         if (a[i].x > a[i - 1].x) {           ans += test(NORTH, a, a[i].x + 0.5, a[i].y);         } else {           ans += test(NORTH, a, a[i].x - 0.5, a[i].y);         }       }     }     cout << ans <<   n ;     return 0;   }   