Language: C++

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;

double calc12(double p1, double p2)
{
	return (p2 + p1) / 2;
}

double calc13(double p1, double p2)
{
	return (p2 - p1) / 3 + p1;
}

double calc23(double p1, double p2)
{
	return (p2 - p1) * 2 / 3 + p1;
}

//////
class Point {
public:
	double x;
	double y;
	Point *p_next = NULL;
	Point(double x, double y);
	Point();
	void link(Point *p_newp);
};

Point::Point() { ; }

Point::Point(double x, double y)
{
	Point::x = x; Point::y = y;
}

void Point::link(Point *p_newp)
{
	p_newp->p_next = p_next;
	p_next = p_newp;
}

//////
class PointS : public Point {
public:
	PointS(Point *p1, Point *p2);
};

PointS::PointS(Point *p1, Point *p2)
{
	x = calc13(p1->x, p2->x);
	y = calc13(p1->y, p2->y);
	p1->link(this);
}

//////
class PointT : public Point {
public:
	PointT(Point *p1, Point *p2);
};

PointT::PointT(Point *p1, Point *p2)
{
	x = calc23(p1->x, p2->x);
	y = calc23(p1->y, p2->y);
	p1->link(this);
}

//////
class PointU : public Point {
public:
	PointU(Point *p1, Point *p2);
};

PointU::PointU(Point *p1, Point *p2)
{
	//???
	if (p1->y == p2->y && p1->x < p2->x) {
		x = calc12(p1->x, p2->x);
		y = (p2->x - p1->x) / 2 * tan(1 / 6);
		//
	}
	else if (p1->y > p2->y && p1->x < p2->x) {
		x = p2->x;
		y = calc23(p2->y, p1->y);
		//
	}
	else if (p1->y > p2->y && p1->x > p2->x) {
		x = p1->x;
		y = calc13(p2->y, p1->y);
		//???
	}
	else if (p1->y == p2->y && p1->x > p2->x) {
		x = calc12(p2->x, p1->x);
		y = (p1->x - p2->x) / 2 * (-tan(1 / 6));
		//
	}
	else if (p1->y < p2->y && p1->x > p2->x) {
		x = p2->x;
		y = calc13(p1->y, p2->y);
		//
	}
	else if (p1->y < p2->y && p1->x < p2->x) {
		x = p1->x;
		y = calc23(p1->y, p2->y);
	}
	p1->link(this);
}

void drawKochCurve(Point *p1, Point *p2, int n, int cnt);

//////
int main(void)
{
	int n;
	cin >> n;

	Point p1(0, 0);
	Point p2(100, 0);
	p1.p_next = &p2;

	drawKochCurve(&p1, &p2, n, 0);

	Point *p_p = &p1;

	for (p_p != NULL) {
		cout << p_p->x << " " << p_p->y << endl;
		p_p = p_p->p_next;
	}

	return 0;
}

void drawKochCurve(Point *p1, Point *p2, int n, int cnt)
{
	if (cnt >= n) return;

	PointS *ps = new PointS(p1, p2);
	PointT *pt = new PointT(p1, p2);
	PointU *pu = new PointU(p1, p2);

	cnt++;

	drawKochCurve(p1, ps, n, cnt);
	drawKochCurve(ps, pu, n, cnt);
	drawKochCurve(pu, pt, n, cnt);
	drawKochCurve(pt, p2, n, cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:130:25: error: expected ';' before ')' token
  130 |         for (p_p != NULL) {
      |                         ^
a.cc:135:9: error: expected primary-expression before 'return'
  135 |         return 0;
      |         ^~~~~~
a.cc:133:10: error: expected ';' before 'return'
  133 |         }
      |          ^
      |          ;
  134 | 
  135 |         return 0;
      |         ~~~~~~
a.cc:135:9: error: expected primary-expression before 'return'
  135 |         return 0;
      |         ^~~~~~
a.cc:133:10: error: expected ')' before 'return'
  133 |         }
      |          ^
      |          )
  134 | 
  135 |         return 0;
      |         ~~~~~~
a.cc:130:13: note: to match this '('
  130 |         for (p_p != NULL) {
      |             ^