Language: C++

#include <iostream>
using namespace std;

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

	float point[2][4097];
	point[0][0] = 0; point[1][0] = 0; point[0][4096] = 100; point[1][4096] = 0;
	double l = 100;

	for(int i = 0; i < n; i++){
		l /= 3;
		int step = pow(4.0,6-i);
		int step4 = step / 4;
		for(int j = 0; j < 4096; j += step){
			point[0][j + step4] = point[0][j] / 3 * 2 + point[0][j + step] / 3;
			point[1][j + step4] = point[1][j] / 3 * 2 + point[1][j + step] / 3;
			point[0][j + step4 * 3] = point[0][j] / 3 + point[0][j + step] / 3 * 2;
			point[1][j + step4 * 3] = point[1][j] / 3 + point[1][j + step] / 3 * 2;

			if(point[0][j] < point[0][j + step]){
				if(point[1][j] < point[1][j + step]){
					point[0][j + step4 * 2] = point[0][j + step4] - l / 2;
					point[1][j + step4 * 2] = point[1][j + step4] + l / 2 * sqrt(3.0);
				}
				else if(point[1][j] > point[1][j]){
					point[0][j + step4 * 2] = point[0][j + step4] + l;
					point[1][j + step4 * 2] = point[1][j + step4];
				}
				else{
					point[0][j + step4 * 2] = point[0][j + step4] + l / 2;
					point[1][j + step4 * 2] = point[1][j + step4] + l / 2 * sqrt(3.0);
				}
			}
			else{
				if(point[1][j] < point[1][j + step]){
					point[0][j + step4 * 2] = point[0][j + step4] - l;
					point[1][j + step4 * 2] = point[1][j + step4];
				}
				else if(point[1][j] > point[1][j]){
					point[0][j + step4 * 2] = point[0][j + step4] + l / 2;
					point[1][j + step4 * 2] = point[1][j + step4] - l / 2 * sqrt(3.0);
				}
				else{
					point[0][j + step4 * 2] = point[0][j + step4] - l / 2;
					point[1][j + step4 * 2] = point[1][j + step4] - l / 2 * sqrt(3.0);
				}
				
			}

		}
	}
	int step = pow(4.0, 6 - n);
	
	for(int i = 0; i < 4097; i += step)
		cout << point[0][i] << " " << point[1][i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: 'pow' was not declared in this scope
   14 |                 int step = pow(4.0,6-i);
      |                            ^~~
a.cc:25:97: error: 'sqrt' was not declared in this scope
   25 |                                         point[1][j + step4 * 2] = point[1][j + step4] + l / 2 * sqrt(3.0);
      |                                                                                                 ^~~~
a.cc:33:97: error: 'sqrt' was not declared in this scope
   33 |                                         point[1][j + step4 * 2] = point[1][j + step4] + l / 2 * sqrt(3.0);
      |                                                                                                 ^~~~
a.cc:43:97: error: 'sqrt' was not declared in this scope
   43 |                                         point[1][j + step4 * 2] = point[1][j + step4] - l / 2 * sqrt(3.0);
      |                                                                                                 ^~~~
a.cc:47:97: error: 'sqrt' was not declared in this scope
   47 |                                         point[1][j + step4 * 2] = point[1][j + step4] - l / 2 * sqrt(3.0);
      |                                                                                                 ^~~~
a.cc:54:20: error: 'pow' was not declared in this scope
   54 |         int step = pow(4.0, 6 - n);
      |                    ^~~