Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <math.h>
using namespace std;

const double Sixty = M_PI*60.0 / 180.0;

struct Point
{
	double x, y;
public:
	Point() { x = y = 0; }
	Point(int x, int y) 
	{ 
		this->x = x;
		this->y = y; 
	}
	void print(){ printf("%.8f %.8f\n", x, y); }
};

void getPoint_div3(Point &r, Point a, Point b) 
{
	r.x = ((a.x * 2.0) + b.x) / 3.0;
	r.y = ((a.y * 2.0) + b.y) / 3.0;
}

void getPoint_top(Point &r, Point a, Point b)
{
	double dx = b.x - a.x;
	double dy = b.y - a.y;

	r.x = cos(Sixty)*dx - sin(Sixty)*dy + a.x;
	r.y = sin(Sixty)*dx + cos(Sixty)*dy + a.y;
}

void koch(int d, Point a, Point b)
{
	if (!d) return;

	Point s, t, u;
	getPoint_div3(s, a, b);
	getPoint_div3(t, b, a);
	getPoint_top(u, s, t);

	koch(d - 1, a, s);
	s.print();
	koch(d - 1, s, u);
	u.print();
	koch(d - 1, u, t);
	t.print();
	koch(d - 1, t, b);
}

int main()
{
	Point p1(0.0, 0.0), p2(100.0, 0.0);
	int n;

	scanf("%d", &n);
	
	p1.print();
	koch(n, p1, p2);
	p2.print();

	return 0;
}
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <math.h>
using namespace std;

const double Sixty = M_PI*60.0 / 180.0;

struct Point
{
	double x, y;
public:
	Point() { x = y = 0; }
	Point(int x, int y)
	{
		this->x = x;
		this->y = y;
	}
	void print() { printf("%.8f %.8f\n", x, y); }
};

void getPoint_div3(Point &r, Point a, Point b)
{
	r.x = ((a.x * 2.0) + b.x) / 3.0;
	r.y = ((a.y * 2.0) + b.y) / 3.0;
}

void getPoint_top(Point &r, Point a, Point b)
{
	double dx = b.x - a.x;
	double dy = b.y - a.y;

	r.x = cos(Sixty)*dx - sin(Sixty)*dy + a.x;
	r.y = sin(Sixty)*dx + cos(Sixty)*dy + a.y;
}

void koch(int d, Point a, Point b)
{
	if (!d) return;

	Point s, t, u;
	getPoint_div3(s, a, b);
	getPoint_div3(t, b, a);
	getPoint_top(u, s, t);

	koch(d - 1, a, s);
	s.print();
	koch(d - 1, s, u);
	u.print();
	koch(d - 1, u, t);
	t.print();
	koch(d - 1, t, b);
}

Compiler output:
a.cc:74:14: error: redefinition of 'const double Sixty'
   74 | const double Sixty = M_PI*60.0 / 180.0;
      |              ^~~~~
a.cc:7:14: note: 'const double Sixty' previously defined here
    7 | const double Sixty = M_PI*60.0 / 180.0;
      |              ^~~~~
a.cc:76:8: error: redefinition of 'struct Point'
   76 | struct Point
      |        ^~~~~
a.cc:9:8: note: previous definition of 'struct Point'
    9 | struct Point
      |        ^~~~~
a.cc:89:6: error: redefinition of 'void getPoint_div3(Point&, Point, Point)'
   89 | void getPoint_div3(Point &r, Point a, Point b)
      |      ^~~~~~~~~~~~~
a.cc:22:6: note: 'void getPoint_div3(Point&, Point, Point)' previously defined here
   22 | void getPoint_div3(Point &r, Point a, Point b)
      |      ^~~~~~~~~~~~~
a.cc:95:6: error: redefinition of 'void getPoint_top(Point&, Point, Point)'
   95 | void getPoint_top(Point &r, Point a, Point b)
      |      ^~~~~~~~~~~~
a.cc:28:6: note: 'void getPoint_top(Point&, Point, Point)' previously defined here
   28 | void getPoint_top(Point &r, Point a, Point b)
      |      ^~~~~~~~~~~~
a.cc:104:6: error: redefinition of 'void koch(int, Point, Point)'
  104 | void koch(int d, Point a, Point b)
      |      ^~~~
a.cc:37:6: note: 'void koch(int, Point, Point)' previously defined here
   37 | void koch(int d, Point a, Point b)
      |      ^~~~