Language: C++

#include <math.h>
#include <cassert>
#include <algorithm>
#include <string>
#include <iostream>

using namespace std;

vector<pair<double, double> > p;
const double r60 = M_PI / 3;

pair<double,double> rotate60(pair<double, double> set)
{
    return {set.first * cos(r60) - set.second * sin(r60),set.first*sin(r60) + set.second*cos(r60)};
}

pair<double, double> tri(pair<double, double> p1, pair<double, double> p2)
{
    if(p1.first - p2.first > -0.00001 && p1.first - p2.second < 0.00001)
        return {p1.first - fabs(p1.second - p2.second)* sqrt(3) / 2,(p1.second + p2.second) / 2};
    double a = (p1.second - p2.second)/(p1.first - p2.first);
    if(a > -0.00001 && a < 0.00001)
        return {(p1.first + p2.first) / 2, fabs(p2.first - p1.first) * sqrt(3) / 2};
    pair<double,double> rem = {p2.first-p1.first,p2.second-p1.second};
    rem = rotate60(rem);
    return {p1.first + rem.first, p1.second + rem.second};
}

void koch(vector<pair<double, double> > &v, int depth, int start)
{
    if(depth >= 1)
    {
        v.insert(v.begin()+ start + 1
                 ,{{(v[start].first* 2 + v[start+1].first) / 3,(v[start].second* 2 + v[start+1].second) / 3}
                     ,{(v[start].first + v[start+1].first*2)/3,(v[start].second + v[start+1].second*2)/3}});
        v.insert(v.begin()+start+2,tri(v[start+1],v[start+2]));
        if(depth > 1)
        {
            for(int i = (int)v.size()-2; i >= 0; i--)
            {
                koch(v, depth-1, i);
            }
        }
    }

}


int main() {
    int n;
    cin >> n;
    p.push_back({0.0,0.0});
    p.push_back({100.0,0.0});
    koch(p,n,0);
    for(int i = 0; i < p.size(); i++)
        cout << p[i].first << " " << p[i].second << endl;
    
    return 0;
}

Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<pair<double, double> > p;
      | ^~~~~~
a.cc:29:6: error: variable or field 'koch' declared void
   29 | void koch(vector<pair<double, double> > &v, int depth, int start)
      |      ^~~~
a.cc:29:11: error: 'vector' was not declared in this scope
   29 | void koch(vector<pair<double, double> > &v, int depth, int start)
      |           ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include <iostream>
  +++ |+#include <vector>
    6 | 
a.cc:29:39: error: expected primary-expression before '>' token
   29 | void koch(vector<pair<double, double> > &v, int depth, int start)
      |                                       ^
a.cc:29:42: error: 'v' was not declared in this scope
   29 | void koch(vector<pair<double, double> > &v, int depth, int start)
      |                                          ^
a.cc:29:45: error: expected primary-expression before 'int'
   29 | void koch(vector<pair<double, double> > &v, int depth, int start)
      |                                             ^~~
a.cc:29:56: error: expected primary-expression before 'int'
   29 | void koch(vector<pair<double, double> > &v, int depth, int start)
      |                                                        ^~~
a.cc: In function 'int main()':
a.cc:52:5: error: 'p' was not declared in this scope
   52 |     p.push_back({0.0,0.0});
      |     ^
a.cc:54:5: error: 'koch' was not declared in this scope
   54 |     koch(p,n,0);
      |     ^~~~