Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
void insert(int);
void _delete(int);
void deleteFirst(void);
void deleteLast(void);
#define N 2000020
int li[N], pl[N], pl2[N],first, last,, cou = 0, now = 0;
int main(void)
{
	first = last = 0;
	li[0] = -1;
	int n, x;
	int cou_a = 0, cou_b = 0, cou_c = 0, cou_d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string command;
		cin >> command;
		if (command == "insert") {
			cin >> x;
			insert(x); 
			cou_a++;
		}
		if (command == "delete") { 
			cin >> x;
			_delete(x); 
			cou_b++;
		}
		if (command == "deleteFirst") { deleteFirst(); 			cou_c++;}
		if (command == "deleteLast") { deleteLast(); 			cou_d++;}
		}
	for (int i = 0, f = first; ; i++) {
		printf("%d", li[f]);
		if (last == f || li[f] == -1) break;
		f = pl[f];
		printf(" ");
	}
	puts("");
}
void insert(int a)
{
	li[cou] = a;
	pl2[first] = cou;
	pl[cou] = first;
	first = cou;
	if (now == 0) last = cou;
	cou++; now++;
}
void _delete(int a)
{
	int f, fb, fa;
	f = first;
	if (now >= 2) {
		for (int i = 0; i < cou && now != 0; i++) {
			if (a == li[f]) {
				fa = pl[f]; fb = pl2[f];
				if (f == first) { first = pl[f]; }
				else { pl[fb] = pl[f]; }
				if (f == last) { last = pl2[f]; }
				else { pl2[pl[f]] = pl2[f]; }
				now--;
				break;
			}
			if (f == last) break;
			f = pl[f];
		}
	}
	else {
		last = first = cou = 0;
		li[f] = -1;
		now--;
	}
}
void deleteFirst(void)
{
	if (now >= 2) {
		first = pl[first];
		now--;#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
void insert(int);
void _delete(int);
void deleteFirst(void);
void deleteLast(void);
#define N 2000020
int li[N], pl[N], pl2[N],first, last, cou = 0, now = 0;
int main(void)
{
	first = last = 0;
	li[0] = -1;
	int n, x;
	int cou_a = 0, cou_b = 0, cou_c = 0, cou_d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string command;
		cin >> command;
		if (command == "insert") {
			cin >> x;
			insert(x); 
			cou_a++;
		}
		if (command == "delete") { 
			cin >> x;
			_delete(x); 
			cou_b++;
		}
		if (command == "deleteFirst") { deleteFirst(); 			cou_c++;}
		if (command == "deleteLast") { deleteLast(); 			cou_d++;}
		}
	for (int i = 0, f = first; ; i++) {
		printf("%d", li[f]);
		if (last == f || li[f] == -1) break;
		f = pl[f];
		printf(" ");
	}
	puts("");
}
void insert(int a)
{
	li[cou] = a;
	pl2[first] = cou;
	pl[cou] = first;
	first = cou;
	if (now == 0) last = cou;
	cou++; now++;
}
void _delete(int a)
{
	int f, fb, fa;
	f = first;
	if (now >= 2) {
		for (int i = 0; i < cou && now != 0; i++) {
			if (a == li[f]) {
				fa = pl[f]; fb = pl2[f];
				if (f == first) { first = pl[f]; }
				else { pl[fb] = pl[f]; }
				if (f == last) { last = pl2[f]; }
				else { pl2[pl[f]] = pl2[f]; }
				now--;
				break;
			}
			if (f == last) break;
			f = pl[f];
		}
	}
	else {
		last = first = cou = 0;
		li[f] = -1;
		now--;
	}
}
void deleteFirst(void)
{
	if (now >= 2) {
		first = pl[first];
		now--;
	}
	else {
		last = first = cou = 0;
		li[first] = -1;
		now--;
	}
}
void deleteLast(void)
{
	if (now >= 2) {
		last = pl2[last];
		now--;
	}
	else {
		li[last] = -1;
		now--;
	}
}
	}
	else {
		last = first = cou = 0;
		li[first] = -1;
		now--;
	}
}
void deleteLast(void)
{
	if (now >= 2) {
		last = pl2[last];
		now--;
	}
	else {
		li[last] = -1;
		now--;
	}
}

Compiler output:
a.cc:80:23: error: stray '#' in program
   80 |                 now--;#include <stdio.h>
      |                       ^
a.cc:10:38: error: expected unqualified-id before ',' token
   10 | int li[N], pl[N], pl2[N],first, last,, cou = 0, now = 0;
      |                                      ^
a.cc: In function 'void deleteFirst()':
a.cc:80:24: error: 'include' was not declared in this scope
   80 |                 now--;#include <stdio.h>
      |                        ^~~~~~~
a.cc:80:33: error: 'stdio' was not declared in this scope; did you mean 'stdin'?
   80 |                 now--;#include <stdio.h>
      |                                 ^~~~~
      |                                 stdin
a.cc:83:1: error: expected primary-expression before 'using'
   83 | using namespace std;
      | ^~~~~
a.cc:91:1: error: a function-definition is not allowed here before '{' token
   91 | {
      | ^
a.cc:122:1: error: a function-definition is not allowed here before '{' token
  122 | {
      | ^
a.cc:131:1: error: a function-definition is not allowed here before '{' token
  131 | {
      | ^
a.cc:156:1: error: a function-definition is not allowed here before '{' token
  156 | {
      | ^
a.cc:168:1: error: a function-definition is not allowed here before '{' token
  168 | {
      | ^