Language: C++

#include <iostream>
#include <iomanip>
#include <math.h> 

#define M_PI 3.14159265358979323846

class Point {
public:
	double x, y;
};

void koch(int n, Point a, Point b)
{
	Point s, t;
	if (n == 0) return;
	s.x = (2 * a.x + b.x) / 3;
	s.y = (2 * a.y + b.y) / 3;
	t.x = (a.x + 2 * b.x) / 3;
	t.y = (a.y + 2 * b.y) / 3;
	Point u;
	double rad = M_PI*(60.0 / 180.0);
	u.x = (t.x - s.x)*cos(rad) - (t.y - s.y)*sin(rad) + s.x;
	u.y = (t.x - s.x)*sin(rad) + (t.y - s.y)*cos(rad) + s.y;
	koch(n - 1, a, s);
	cout << s.x << " " << s.y << endl;
	koch(n - 1, s, u);
	cout << u.x << " " << u.y << endl;
	koch(n - 1, u, t);
	cout << t.x << " " << t.y << endl;
	koch(n - 1, t, b);
}

int main() 
{
	int n;
	cin >> n;
	Point a, b;
	a.x = 0;a.y = 0;
	b.x = 100;b.y = 0;
	cout << fixed << setprecision(8) << a.x << " " << a.y << endl;
	koch(n, a, b);
	cout << fixed << setprecision(8) << b.x << " " << b.y << endl;
}

Compiler output:
a.cc: In function 'void koch(int, Point, Point)':
a.cc:25:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |         cout << s.x << " " << s.y << endl;
      |         ^~~~
      |         std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |         cout << s.x << " " << s.y << endl;
      |                                      ^~~~
      |                                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'int main()':
a.cc:36:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   36 |         cin >> n;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:40:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   40 |         cout << fixed << setprecision(8) << a.x << " " << a.y << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:40:17: error: 'fixed' was not declared in this scope; did you mean 'std::fixed'?
   40 |         cout << fixed << setprecision(8) << a.x << " " << a.y << endl;
      |                 ^~~~~
      |                 std::fixed
In file included from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40:
/usr/include/c++/14/bits/ios_base.h:1104:3: note: 'std::fixed' declared here
 1104 |   fixed(ios_base& __base)
      |   ^~~~~
a.cc:40:26: error: 'setprecision' was not declared in this scope; did you mean 'std::setprecision'?
   40 |         cout << fixed << setprecision(8) << a.x << " " << a.y << endl;
      |                          ^~~~~~~~~~~~
      |                          std::setprecision
In file included from a.cc:2:
/usr/include/c++/14/iomanip:202:3: note: 'std::setprecision' declared here
  202 |   setprecision(int __n)
      |   ^~~~~~~~~~~~
a.cc:40:66: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   40 |         cout << fixed << setprecision(8) << a.x << " " << a.y << endl;
      |                                                                  ^~~~
      |                                                                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~