criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
using namespace std;

class Node{
public:
	Node* prev;
	Node* next;
	int data;
	Node(){prev=0;next=0;data=0;}
};

class List{
private:
	Node head;
public:
	List(){head.prev=&head;head.next=&head;}
	int insert(int x);
	int del(int x);
	int deleteFirst();
	int deleteLast();
	void print();
};

int List::insert(int x)
{
	Node* p=new Node();

	if(p==0)
		return -1;
	Node* q=&head;
	Node* r=head.next;

	p->prev=q;
	p->next=r;
	p->data=x;

	q->next=p;
	r->prev=p;
	return 0;
}

int List::del(int x)
{
	Node* p;

	for(p=head.next;p!=&head; p=p->next){
		if(p->data==x)
			break;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;
}

int List::deleteFirst()
{
	Node* p=head.next;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;


}

int List::deleteLast()
{
	Node* p=head.prev;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;
}

void List::print()
{
	for(Node* p=head.next;p!=&head; p=p->next){
		cout<<p->data;

		if(p->next!=&head){
			cout<<' ';
		}else{
			cout<<endl;
		}
	}
}

}

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

	for (int i = 0; i < n; i++) {
		char com[20];
		cin >> com;

		if (com[0] == 'i') {
			int x;
			cin >> x;
			L.insert(x);
		}
		else if (com[6] == 'F') {
			L.deleteFirst();
		}
		else if (com[6] == 'L') {
			L.deleteLast();
		}
		else {
			int x;
			cin >> x;
			L.del(x);
		}
	}

}

Compiler output:
a.cc: In member function 'int List::del(int)':
a.cc:63:22: error: qualified-id in declaration before '(' token
   63 | int List::deleteFirst()
      |                      ^
a.cc:82:21: error: qualified-id in declaration before '(' token
   82 | int List::deleteLast()
      |                     ^
a.cc:99:17: error: qualified-id in declaration before '(' token
   99 | void List::print()
      |                 ^
a.cc:112:1: warning: control reaches end of non-void function [-Wreturn-type]
  112 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

class Node{
public:
	Node* prev;
	Node* next;
	int data;
	Node(){prev=0;next=0;data=0;}
};

class List{
private:
	Node head;
public:
	List(){head.prev=&head;head.next=&head;}
	int insert(int x);
	int del(int x);
	int deleteFirst();
	int deleteLast();
	void print();
};

int List::insert(int x)
{
	Node* p=new Node();

	if(p==0)
		return -1;
	Node* q=&head;
	Node* r=head.next;

	p->prev=q;
	p->next=r;
	p->data=x;

	q->next=p;
	r->prev=p;
	return 0;
}

int List::del(int x)
{
	Node* p;

	for (p = head.next; p != &head; p = p->next) {
		if (p->data == x)
			break;
	}

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;
}

int List::deleteFirst()
{
	Node* p=head.next;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;


}

int List::deleteLast()
{
	Node* p=head.prev;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;
}

void List::print()
{
	for(Node* p=head.next;p!=&head; p=p->next){
		cout<<p->data;

		if(p->next!=&head){
			cout<<' ';
		}else{
			cout<<endl;
		}
	}
}

}

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

	for (int i = 0; i < n; i++) {
		char com[20];
		cin >> com;

		if (com[0] == 'i') {
			int x;
			cin >> x;
			L.insert(x);
		}
		else if (com[6] == 'F') {
			L.deleteFirst();
		}
		else if (com[6] == 'L') {
			L.deleteLast();
		}
		else {
			int x;
			cin >> x;
			L.del(x);
		}
	}

}

Compiler output:
a.cc:113:1: error: expected declaration before '}' token
  113 | }
      | ^
Language: C++

#include <iostream>
#include <cassert>
#include <stdlib.h>
#include <stdio.h>
// #include <queue>

#define INF 922337203685477580
typedef long long ll;

using namespace std;

struct List_t {
  ll key;
  struct List_t* prev;
  struct List_t* next;
};
typedef struct List_t List;
List *head;

void insert(ll x) {
  List *l = (List*)malloc(sizeof(List));

  l->prev = head;
  l->next = head->next;
  l->next->prev = l;
  head->next = l;
  l->key = x;
}
List* find(ll x) {
  for (List* i = head->next; i != head; i = i->next) {
    if (i->key == x) {
      return i;
    }
  }
  // assert(0);
  return NULL;
}
void del(List* l) {
  if (l == NULL) return;
  // List *l = find(x);
  l->prev->next = l->next;
  l->next->prev = l->prev;

  free(l);
}
void deleteLast() {
  del(head->prev);
}
void deleteFirst() {
  del(head->next);
}

int main() {
  head = (List*)malloc(sizeof(List));
  head->prev = head;
  head->next = head;


  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    // string cmd;
    char cmd[100];
    // cin >> cmd;
    scanf("%s", cmd);
    // if (cmd == "insert") {
    if (strcmp("insert", cmd)) {
      ll key;
      // cin >> key;
      scanf("%lld", &key);

      insert(key);
    // } else if (cmd == "delete") {
    } else if (strcmp("delete", cmd)) {
      ll key;
      // cin >> key;
      scanf("%lld", &key);

      List* t = find(key);
      del(t);
    } else if (strcmp("deleteFirst", cmd)) {
      deleteFirst();
    } else if (strcmp("deleteLast", cmd)) {
      deleteLast();
    } else {
      assert(0);
    }
  }

  for (List* i = head->next; i != head; i = i->next) {
    if (i != head->next) {
      cout << " ";
    }
    cout << i->key;
  }
  cout << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:9: error: 'strcmp' was not declared in this scope
   68 |     if (strcmp("insert", cmd)) {
      |         ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <stdlib.h>
  +++ |+#include <cstring>
    4 | #include <stdio.h>
Language: C++

 42   free(t);
#include <cstdio>
#include <cstdlib>
#include <cstring>

typedef struct node {
  int key;
  node *prev, *next;
} N;

N *nil;

void init() {
  nil = (N *)malloc(sizeof(N));
  nil->next = nil;
  nil->prev = nil;
}

N* listSearch(int key) {
  N *cur = nil->next;
  while ( cur != nil && cur->key != key ) {
    cur = cur->next;
  }
  return cur;
}

void printList() {
  N *cur = nil->next;
  int isf = 0;
  while ( 1 ) {
    if ( cur == nil ) break;
    if ( isf++ > 0 ) printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(N *t) {
  if ( t == nil ) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void insert(int key) {
  N *x = (N *)malloc(sizeof(N));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

void deleteFirst() {
  deleteNode(nil->next);
}

void deleteLast() {
  deleteNode(nil->prev);
}

void deletekey(int key) {
  deleteNode(listSearch(key));
}

int main() {
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ) {
    scanf("%s%d", com, &key);
    if ( com[0] == 'i') { insert(key); np++; size++; }
    else if ( com[0] == 'd' ) {
      if ( strlen(com) > 6 ) {
        if ( com[6] == 'F' ) deleteFirst();
        else if ( com[6] == 'L' ) deleteLast();
      } else {
        deleteKey(key); nd++;
      }
      size--;
    }
  }

  printfList();

  return 0;
}

Compiler output:
a.cc:1:2: error: expected unqualified-id before numeric constant
    1 |  42   free(t);
      |  ^~
a.cc: In function 'int main()':
a.cc:82:9: error: 'deleteKey' was not declared in this scope; did you mean 'deletekey'?
   82 |         deleteKey(key); nd++;
      |         ^~~~~~~~~
      |         deletekey
a.cc:88:3: error: 'printfList' was not declared in this scope; did you mean 'printList'?
   88 |   printfList();
      |   ^~~~~~~~~~
      |   printList
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>

typedef struct node {
  int key;
  node *prev, *next;
} N;

N *nil;

void init() {
  nil = (N *)malloc(sizeof(N));
  nil->next = nil;
  nil->prev = nil;
}

N* listSearch(int key) {
  N *cur = nil->next;
  while ( cur != nil && cur->key != key ) {
    cur = cur->next;
  }
  return cur;
}

void printList() {
  N *cur = nil->next;
  int isf = 0;
  while ( 1 ) {
    if ( cur == nil ) break;
    if ( isf++ > 0 ) printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(N *t) {
  if ( t == nil ) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void insert(int key) {
  N *x = (N *)malloc(sizeof(N));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

void deleteFirst() {
  deleteNode(nil->next);
}

void deleteLast() {
  deleteNode(nil->prev);
}

void deletekey(int key) {
  deleteNode(listSearch(key));
}

int main() {
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ) {
    scanf("%s%d", com, &key);
    if ( com[0] == 'i') { insert(key); np++; size++; }
    else if ( com[0] == 'd' ) {
      if ( strlen(com) > 6 ) {
        if ( com[6] == 'F' ) deleteFirst();
        else if ( com[6] == 'L' ) deleteLast();
      } else {
        deleteNode(key); nd++;
      }
      size--;
    }
  }

  printList();

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:20: error: invalid conversion from 'int' to 'N*' {aka 'node*'} [-fpermissive]
   81 |         deleteNode(key); nd++;
      |                    ^~~
      |                    |
      |                    int
a.cc:38:20: note:   initializing argument 1 of 'void deleteNode(N*)'
   38 | void deleteNode(N *t) {
      |                 ~~~^
Language: C++

#include <cstdio>
#include <list>
#include <algorithm>
using namespace std;

int main() {
  int q, x;
  char com[20];

  list<int> v;
  scanf("%d", &q);
  for ( int i = 0; i < q; i++ ) {
    scanf("%s", com);
    if ( com[0] == 'i' ) {
      scanf("%d", &x);
      v.push_front(x);
    } else if ( com[6] == 'L' ) {
      v.pop_back();
    } else if ( com[6] == 'F' ) {
      v.pop_front();
    } else if ( com[0] == 'd' ) {
      scanf("%d", &x);
      for ( list<int>::iterator it = v.begin(); it != v.end(); it++ ) {
        if ( *it == x ) {
          v.erase(it);
          break;
        }
      }
    }
  }

  int i = 0;
  for ( list<int>::iterator it == v.begin(); it != v.end(); it++ ) {
    if ( i++ ) printf(" ");
    printf("%d", *it);
  }
  printf("\n");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:31: error: expected ';' before '==' token
   33 |   for ( list<int>::iterator it == v.begin(); it != v.end(); it++ ) {
      |                               ^~~
      |                               ;
a.cc:33:32: error: expected primary-expression before '==' token
   33 |   for ( list<int>::iterator it == v.begin(); it != v.end(); it++ ) {
      |                                ^~
a.cc:33:49: warning: ignoring return value of 'bool std::operator!=(const _List_iterator<int>::_Self&, const _List_iterator<int>::_Self&)', declared with attribute 'nodiscard' [-Wunused-result]
   33 |   for ( list<int>::iterator it == v.begin(); it != v.end(); it++ ) {
      |                                              ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/list:65,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_list.h:325:7: note: declared here
  325 |       operator!=(const _Self& __x, const _Self& __y) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:33:59: error: expected ')' before ';' token
   33 |   for ( list<int>::iterator it == v.begin(); it != v.end(); it++ ) {
      |       ~                                                   ^
      |                                                           )
a.cc:33:61: error: 'it' was not declared in this scope; did you mean 'i'?
   33 |   for ( list<int>::iterator it == v.begin(); it != v.end(); it++ ) {
      |                                                             ^~
      |                                                             i
Language: C++

#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;

struct Node {
	int key;
	Node *prev, *next;
};

Node* nil;

void initialize() {
	nil = new Node;
	nil->next = nil;
	nil->prev = nil;
}

void insert(int key) {
	Node* n = new Node;
	n->key = key;

	n->next = nil->next;
	n->prev = nil;
	n->next->prev = n;
	nil->next = n;
}

Node* listSearch(int key) {
	Node* cur = nil->next;
	while (cur != nil && cur->key != key) {
		cur = cur->next;
	}
	return cur;
}

void deleteNode(Node *t) {
	if (t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	delete t;
}

void deleteFirst() {
	deleteNode(nil->next);
}

void deleteLast() {
	deleteNode(nil->prev);
}

void deleteKey(int key) {
	deleteNode(listSearch(key));
}

void print() {
	Node* cur = nil->next;
	int i = 1;
	while (cur != nil) {
		cout << i++ << "th node's key : " << cur->key << endl;
		cur = cur->next;
	}
}

void printList() {
	Node* cur = nil->next;
	if (cur != nil) {
		cout << cur->key;
		cur = cur->next;
	}
	while (cur != nil) {
		cout << ' ' << cur->key;
		cur = cur->next;
	}
	cout << endl;
}

int main() {
	int n, key;
	char command[20];

	initialize();

	cin >> n;

	for (int i = 0; i < n; i++) {
		scanf("%s%d", command, &key);
		//cout << command << ' ' << key << endl;
		if (command[0] == 'i') insert(key);
		else if (command[0] == 'd') {
			if (strlen(command) > 6) {
				if (command[6] == 'F') deleteFirst();
				else if (command[6] == 'L') deleteLast();
			}
			else deleteKey(key);
		}
	}
	printList();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:29: error: 'strlen' was not declared in this scope
   91 |                         if (strlen(command) > 6) {
      |                             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <string>

using namespace std;

struct node{
    int x;
    node* prev,*next;
};

node *head;

void init(){
    head=new node();
    head->next=head;
    head->prev=head;
}

void insertnode(int key){
    node *n=new node();
    n->x=key;
    n->next=head->next;
    head->next->prev=n;
    n->prev=head;
    head->next=n;
}

node* searchnode(int key){
    node *cur=head->next;
    while(cur!=head&&cur->x!=key){
        cur=cur->next;
    }
    return cur;
}

void deletenode(int k){
    node *n=searchnode(k);
    if(n==head)return;
    n->next->prev=n->prev;
    n->prev->next=n->next;
    delete(n);
}

void printlist(){
    node* n=head->next;
    while(n!=head){
        cout<<n->x;
        if(n->next!=head)cout<<" ";
        n=n->next;
    }
}

void deleteFirst(){
    head->next->next->prev=head;
    head->next=head->next->next;
    delete(head->next);
}

void deleteLast(){
    head->prev->prev->next=head;
    head->prev=head->prev->prev;
    delete(head->prev);
}

int main()
{
    init();
    int n;
    cin>>n;
    int i,j;
    for(i=0;i<n;i++){
        string operate;
        int key;
        cin>>operate>>key;
        if(operate=="insert"){
            insertnode(key);
        }else{
            if(strlen(operate)>6){
                if(operate[6]=='F')deleteFirst();
                if(operate[6]=='L')deleteLast();
            }else{
                deletenode(key);
            }
        }
    }
    printlist();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:16: error: 'strlen' was not declared in this scope
   78 |             if(strlen(operate)>6){
      |                ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++


    int n;
    cin>>n;
    int i,j;
    for(i=0;i<n;i++){
        string operate;
        int key;
        cin>>operate>>key;
        if(operate=="insert"){
            insertnode(key);
        }else{
            if(operate.length()>6){
                if(operate[6]=='F')deleteFirst();
                if(operate[6]=='L')deleteLast();
            }else{
                deletenode(key);
            }
        }
    }
    printlist();
    return 0;
}

Compiler output:
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin>>n;
      |     ^~~
a.cc:5:5: error: expected unqualified-id before 'for'
    5 |     for(i=0;i<n;i++){
      |     ^~~
a.cc:5:13: error: 'i' does not name a type
    5 |     for(i=0;i<n;i++){
      |             ^
a.cc:5:17: error: 'i' does not name a type
    5 |     for(i=0;i<n;i++){
      |                 ^
a.cc:20:16: error: expected constructor, destructor, or type conversion before ';' token
   20 |     printlist();
      |                ^
a.cc:21:5: error: expected unqualified-id before 'return'
   21 |     return 0;
      |     ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

struct node{
    int x;
    node* prev,*next;
};

node *head;

void init(){
    head=new node();
    head->next=head;
    head->prev=head;
}

void insertnode(int key){
    node *n=new node();
    n->x=key;
    n->next=head->next;
    head->next->prev=n;
    n->prev=head;
    head->next=n;
}

node* searchnode(int key){
    node *cur=head->next;
    while(cur!=head&&cur->x!=key){
        cur=cur->next;
    }
    return cur;
}

void deletenode(int k){
    node *n=searchnode(k);
    if(n==head)return;
    n->next->prev=n->prev;
    n->prev->next=n->next;
    delete(n);
}

void printlist(){
    node* n=head->next;
    while(n!=head){
        cout<<n->x;
        if(n->next!=head)cout<<" ";
        n=n->next;
    }
    cout<<endl;
}

void deleteFirst(){
    node *n=head->next;
    head->next->next->prev=head;
    head->next=head->next->next;
    delete(n);
}

void deleteLast(){
    node *n=head->prev;
    head->prev->prev->next=head;
    head->prev=head->prev->prev;
    delete(n);
}

int main()
{
    init();
    int n;
    cin>>n;
    int i,j;
    for(i=0;i<n;i++){
        string operate;
        int key;
        scanf("%s%d",operate,&key);
//        if(operate.length()<=6)cin>>key;
        if(operate=="insert"){
            insertnode(key);
        }else{
            if(operate.length()>6){
                if(operate=="deleteFirst")deleteFirst();
                if(operate=="deleteLast")deleteLast();
            }else{
                deletenode(key);
            }
        }
    }
    printlist();
    return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #incldue; did you mean #include?
    3 | #incldue <stdio.h>
      |  ^~~~~~~
      |  include
Language: C++

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;

int main()
{
	int q, x;
	char com[20];
	list<int> v;
	list<int>::iterator it;
	scanf("%d", &q);
	for (int i = 0; i < q; i++)
	{
		scanf("%s", com);
		if (com[0] == 'i') {
			scanf("%d", &x);
			v.push_front(x);
		}
		else if (com[6] == 'L') {
			v.pop_back();
		}
		else if (com[6] == 'F') {
			v.pop_front();
		}
		else if (com[0] == 'd') {
			scanf("%d", &x);
			for (it = v.begin(); it != v.end(); it++) {
				if (*it == x) {
					v.erase(x);
					break;
				}
			}
		}
	}
	int i = 0;
	for (it = v.begin(); it != v.end(); it++) {
		if (i++) pritnf(" ");
		printf("%d", *it);
	}
	printf("\n");

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:48: error: no matching function for call to 'std::__cxx11::list<int>::erase(int&)'
   30 |                                         v.erase(x);
      |                                         ~~~~~~~^~~
In file included from /usr/include/c++/14/list:66,
                 from a.cc:2:
/usr/include/c++/14/bits/list.tcc:150:5: note: candidate: 'std::__cxx11::list<_Tp, _Alloc>::iterator std::__cxx11::list<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::__cxx11::list<int>::iterator; const_iterator = std::__cxx11::list<int>::const_iterator]'
  150 |     list<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/list.tcc:152:26: note:   no known conversion for argument 1 from 'int' to 'std::__cxx11::list<int>::const_iterator'
  152 |     erase(const_iterator __position) noexcept
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/list:65:
/usr/include/c++/14/bits/stl_list.h:1559:7: note: candidate: 'std::__cxx11::list<_Tp, _Alloc>::iterator std::__cxx11::list<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::__cxx11::list<int>::iterator; const_iterator = std::__cxx11::list<int>::const_iterator]'
 1559 |       erase(const_iterator __first, const_iterator __last) noexcept
      |       ^~~~~
/usr/include/c++/14/bits/stl_list.h:1559:7: note:   candidate expects 2 arguments, 1 provided
a.cc:38:26: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   38 |                 if (i++) pritnf(" ");
      |                          ^~~~~~
      |                          printf
Language: C++

#define _USE_MATH_DEFINES
#include<cmath>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<list>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	char s[15];
	int key;
	list<int> l;
	for (int i = 0; i < n; i++) {
		scanf("%s", s);
		if (s[0] == 'i') {
			scanf("%d", &key);
			l.push_front(key);
		}
		else if (strlen(s) == 6) {
			scanf("%d", &key);
			for (auto it = l.begin(); it != l.end(); it++) {
				if (*it == key) {
					l.erase(it);
					break;
				}
			}
		}
		else if (s[6] == 'F') {
			l.pop_front();
		}
		else if (s[6] == 'L') {
			l.pop_back();
		}
	}

	int i = 0;
	for (auto it = l.begin(); it != l.end(); it++) {
		printf("%d", *it);
		if (i < l.size() - 1)cout << " ";
		i++;
	}
	cout << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: 'strlen' was not declared in this scope
   29 |                 else if (strlen(s) == 6) {
      |                          ^~~~~~
a.cc:13:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include<list>
  +++ |+#include <cstring>
   13 | using namespace std;
Language: C++

#define _USE_MATH_DEFINES
#include<cmath>
#include<cstdio>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<list>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	char s[15];
	int key;
	list<int> l;
	for (int i = 0; i < n; i++) {
		scanf("%s", s);
		if (s[0] == 'i') {
			scanf("%d", &key);
			l.push_front(key);
		}
		else if (strlen(s) == 6) {
			scanf("%d", &key);
			for (auto it = l.begin(); it != l.end(); it++) {
				if (*it == key) {
					l.erase(it);
					break;
				}
			}
		}
		else if (s[6] == 'F') {
			l.pop_front();
		}
		else if (s[6] == 'L') {
			l.pop_back();
		}
	}

	int i = 0;
	for (auto it = l.begin(); it != l.end(); it++) {
		printf("%d", *it);
		if (i < l.size() - 1)cout << " ";
		i++;
	}
	cout << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: 'strlen' was not declared in this scope
   30 |                 else if (strlen(s) == 6) {
      |                          ^~~~~~
a.cc:14:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include<list>
  +++ |+#include <cstring>
   14 | using namespace std;
Language: C++

#include <stdio.h>

int N;
char inst[12];

class Node {
public:
    Node();
    int key;
    Node* p;
    Node* n;
};

Node::Node()
{
    p = NULL;
    n = NULL;
}

class LinkedList {
public:
    LinkedList();
    void insertKey(int key);
    void deleteKey(int key);
    void deleteFirst(void);
    void deleteLast(void);
    void print(void);
    Node* nil;
};

LinkedList::LinkedList()
{
    nil = new Node;
    nil->p = nil;
    nil->n = nil;
}

void LinkedList::insertKey(int key)
{
    Node* node = new Node;
    node->key = key;
    
    node->n = nil->n;
    nil->n->p = node;
    nil->n = node;
    node->p = nil;
}

void LinkedList::deleteKey(int key)
{
    Node* c = nil->n;
    bool is_found = false;
    while(c != nil) {
        if (key == c->key) {
            is_found = true;
            break;
        }
        c = c->n;
    }
    if (is_found) {
        c->n->p = c->p;
        c->p->n = c->n;
    }
}

void LinkedList::deleteFirst(void)
{
    Node* c = nil->n;
    c->n->p = c->p;
    c->p->n = c->n;
}

void LinkedList::deleteLast(void)
{
    Node* c = nil->p;
    c->n->p = c->p;
    c->p->n = c->n;
}

void LinkedList::print(void)
{
    Node* c = nil->n;
    while (c != nil) {
        printf(" %d", c->key);
        c = c->n;
    }
}

int main(void)
{
    LinkedList ll;
    //freopen("in.txt", "r", stdin);
    scanf("%d", &N);
    for (int i = 0; i < N; ++i) {
        scanf("%s", inst);
        int k;
        if (inst[0] == 'i') { // insert
            scanf("%d", &k);
            ll.insertKey(k);
        } else {
            if (inst[6] == 'F') { // deleteFirst
                ll.deleteFirst();
            } else if (inst[6] == 'L') { // deleteLast
                ll.deleteLast();
            } else { // delete
                scanf("%d", &k);
                ll.deleteKey(k);
            }
        }
    }
    ll.print();
    printf("\n);
    return 0;
}

Compiler output:
a.cc:112:12: warning: missing terminating " character
  112 |     printf("\n);
      |            ^
a.cc:112:12: error: missing terminating " character
  112 |     printf("\n);
      |            ^~~~~
a.cc: In function 'int main()':
a.cc:113:5: error: expected primary-expression before 'return'
  113 |     return 0;
      |     ^~~~~~
Language: C++

#include <cassert>
#include <cstdio>
#include <string>

class TDllist
{
    int* FList; //[4000000];
    int FBegin;
    int FEnd;
public:
    TDllist()
    {
        FList = new int[4000000];
        FBegin = 2000000;
        FEnd  = 2000000;
    }
    ~TDllist()
    {
        delete[] FList;
    }
    void Insert(int X)
    {
        --FBegin;
        FList[FBegin] = X;
    }
    void Delete(int X)
    {
        int Index = FEnd;
        for(int i = FBegin; i < FEnd; ++i){
            if(X == FList[i]){
                Index = i;
                break;
            }
        }
        if(Index == FEnd) return;
        for(int i = Index; i < FEnd; ++i){
            FList[i] = FList[i+1];
        }
        FEnd--;
    }
    void DeleteFirst()
    {
        FBegin++;
    }
    void DeleteLast()
    {
        FEnd--;
    }
    void Show()const
    {
        printf("%d", FList[FBegin]);
        for(int i = FBegin + 1; i < FEnd; ++i){
            printf(" %d", FList[i]);
        }
        printf("\n");
    }
};

int main()
{
    TDllist List;
    int n, X;
    std::scanf("%d", &n);
    char com[17];
    for(int i = 0; i < n; ++i){
        std::gets(com);
        if(com[6] == 'F'){
            List.DeleteFirst();
        }else
        if(com[6] == 'L'){
            List.DeleteLast();
        }else{
            int v = 0;
            for(int j = 7; com[j] != '\0'; ++j){
                v = v*10 + (com[j] - '0');
            }
            if(com[0] == 'i'){
                List.Insert(v);
            }else
            if(com[0] == 'd'){
                List.Delete(v);
            }
        }
    }
    List.Show();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:14: error: 'gets' is not a member of 'std'; did you mean 'getc'?
   66 |         std::gets(com);
      |              ^~~~
      |              getc
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

int main(void) {

  int n;
  cin >> n;
  list<int> l;
  for(int i=0; i<n; i++){
    string s;
    int x;
    cin >> s;
    if( s == "deleteLast" ){
      l.pop_back();
      continue;
    }
    if( s == "deleteFirst" ){
      l.pop_front();
      continue;
    }
    cin >> x;
    if( s == "insert" ){
      l.push_front(x);
    }
    if( s == "delete" ){
      for(auto a=l.begin(); a!=l.end(); a++){
        if( *a == x ){
          l.erase(a);
          break;
        }
      }
    }
  }
  if( l.size() == 0 ) continue;
  while( l.size() != 1 ){
    cout << l.front() << " ";
    l.pop_front();
  }
  cout << l.front() << endl;

  return 0;
}


// EOF

Compiler output:
a.cc: In function 'int main()':
a.cc:47:23: error: continue statement not within a loop
   47 |   if( l.size() == 0 ) continue;
      |                       ^~~~~~~~
Language: C++

#include<iostream>
#include<list>
#include<string>
using namespace std;
int main(){
	list<long long>l; long long n; scanf_s("%lld", &n);
	for (long long i = 0; i < n; i++){
		string s; cin >> s;
		if (s[0] == 'i') { long long k; scanf_s("%lld", &k); l.push_front(k); }
		else{
			if(s.size() == 6){
				long long k; scanf_s("%lld", &k);
				for (auto i = l.begin(); i != l.end(); i++){
					if (*i == k) {
						l.erase(i);
						break;
					}
				}
			}
			else if (s[6] == 'F')l.pop_front();
			else l.pop_back();
		}
	}
	bool y = false;
	for (auto i = l.begin(); i != l.end(); i++){
		if (y)cout << ' ';
		cout << *i;
		y = true;
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    6 |         list<long long>l; long long n; scanf_s("%lld", &n);
      |                                        ^~~~~~~
      |                                        scanf
Language: C++

#include<iostream>
#include<cstdio>
#include<list>
#include<string>
using namespace std;
int main(){
	list<long long>l; long long n; scanf_s("%lld", &n);
	for (long long i = 0; i < n; i++){
		string s; cin >> s;
		if (s[0] == 'i') { long long k; scanf_s("%lld", &k); l.push_front(k); }
		else{
			if(s.size() == 6){
				long long k; scanf_s("%lld", &k);
				for (auto i = l.begin(); i != l.end(); i++){
					if (*i == k) {
						l.erase(i);
						break;
					}
				}
			}
			else if (s[6] == 'F')l.pop_front();
			else l.pop_back();
		}
	}
	bool y = false;
	for (auto i = l.begin(); i != l.end(); i++){
		if (y)cout << ' ';
		cout << *i;
		y = true;
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    7 |         list<long long>l; long long n; scanf_s("%lld", &n);
      |                                        ^~~~~~~
      |                                        scanf
Language: C++

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int commandNum = Integer.parseInt(s.nextLine());
		List<Integer> array = new ArrayList<Integer>();
		for(int i = 0; i < commandNum; i++){
			//System.out.println(i);
			String[] line = s.nextLine().split(" ");
			switch (line[0]){
			case "insert":
				array.add(0, Integer.parseInt(line[1]));
				break;
			case "delete":
				int target =  Integer.parseInt(line[1]);
				for(int j = 0; j < array.size(); j++){
					if (array.get(j) == target){
						array.remove(j);
						break;
					}
				}
				break;
			case "deleteFirst":
				array.remove(0);
				break;
			case "deleteLast":
				array.remove(array.size() - 1);
				break;
			}
		}
		String result = "";
		for(int num : array){
			result += Integer.toString(num) + " ";
		}
		result = result.trim();
		System.out.println(result);
		s.close();
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<cstdio>
#include<list>
#include<algorithm>
using namespace std;

int main(void) {
	int q, x;
	char com[20];
	scanf_s("%d", &q);

	list<int> v;

	for (int i = 0;i <= q - 1;i++) {
		scanf_s("%s", com);
		if (com[0] == 'i') {
			scanf_s("%d", &x);
			v.push_front(x);
		}
		else if (com[6] == 'L'){
			v.pop_back();
		}
		else if (com[6] == 'F') {
			v.pop_front();
		}
		else if (com[0] == 'd') {
			scanf_s("%d", &x);
			for (list<int>::iterator it = v.begin();it != v.end();it++) {
				if (*it == x) {
					v.erase(it);
					break;
				}
			}
		}
	}

	int i = 0;
	for (list<int>::iterator it = v.begin();it != v.end();it++) {
		if (i++ > 0)printf(" ");
		printf("%d", *it);
	}
	printf("\n");

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d", &q);
      |         ^~~~~~~
      |         scanf
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stack>
#include<vector>
#include<cmath>
#include<string>
#include<queue>
#include<map>
#include<cstring>
#include<sstream>
#include<vector>
#include<algorithm>
#include<functional>
#include<set>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<time.h>
typedef long long ll;
using namespace std;

struct node {
	int key;
	node *next, *prev;
};

node *nil;

void init() {
	nil = (node*)malloc(sizeof(node));
	nil->next = nil;
	nil->prev = nil;
}

void deleteNode(node *t) {
	if (t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst() {
	deleteNode(nil->next);
}

void deleteLast() {
	deleteNode(nil->prev);
}

node* searchList(int x) {
	for (node* temp = nil->next; temp != nil; temp = temp->next) {
		if (temp->key == x) {
			return temp;
		}
	}
}

void deleteKey(int key) {
	node* t = searchList(key);
	deleteNode(t);
}

void insert(int key) {
	node *t = (node*)malloc(sizeof node);
	t->key = key;
	t->next = nil->next;
	t->prev = nil;
	nil->next->prev = t;
	nil->next = t;
}

void printList() {
	node *t = nil->next;
	while (t != nil) {
		cout << t->key << ' ';
		t = t->next;
	}
	cout << '\b' << endl;
}

int main() {
	//freopen("run.in", "r", stdin);
	//freopen("run.out", "w", stdout);

	init();
	string cmd;
	int n;
	cin >> n;
	int x;
	for (int i = 0; i < n; i++) {
		cin >> cmd;
		if (cmd == "insert") {
			cin >> x;
			insert(x);
		}
		else if (cmd == "delete") {
			cin >> x;
			deleteKey(x);
		}
		else if (cmd == "deleteFirst") {
			deleteFirst();
		}
		else if (cmd == "deleteLast") {
			deleteLast();
		}
	}

	printList();



	return 0;
}

Compiler output:
a.cc: In function 'void insert(int)':
a.cc:65:44: error: expected primary-expression before ')' token
   65 |         node *t = (node*)malloc(sizeof node);
      |                                            ^
a.cc: In function 'node* searchList(int)':
a.cc:57:1: warning: control reaches end of non-void function [-Wreturn-type]
   57 | }
      | ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stack>
#include<vector>
#include<cmath>
#include<string>
#include<queue>
#include<map>
#include<cstring>
#include<sstream>
#include<vector>
#include<algorithm>
#include<functional>
#include<set>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<time.h>
typedef long long ll;
using namespace std;

struct node {
	int key;
	node *next, *prev;
};

node *nil;

void init() {
	nil = (node*)malloc(sizeof(node));
	nil->next = nil;
	nil->prev = nil;
}

void deleteNode(node *t) {
	if (t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst() {
	deleteNode(nil->next);
}

void deleteLast() {
	deleteNode(nil->prev);
}

node* searchList(int x) {
	for (node* temp = nil->next; temp != nil; temp = temp->next) {
		if (temp->key == x) {
			return temp;
		}
	}
}

void deleteKey(int key) {
	node* t = searchList(key);
	deleteNode(t);
}

void insert(int key) {
	node *t = (node*)malloc(sizeof node);
	t->key = key;
	t->next = nil->next;
	t->prev = nil;
	nil->next->prev = t;
	nil->next = t;
}

void printList() {
	node *t = nil->next;
	int i = 0;
	while (t != nil) {
		if (i < 1) {
			i++;
			cout << t->key;
			t = t->next;
			continue;
		}
		
		cout << ' ' << t->key;
		t = t->next;
	}
}

int main() {
	//freopen("run.in", "r", stdin);
	//freopen("run.out", "w", stdout);

	init();
	string cmd;
	int n;
	cin >> n;
	int x;
	for (int i = 0; i < n; i++) {
		cin >> cmd;
		if (cmd == "insert") {
			cin >> x;
			insert(x);
		}
		else if (cmd == "delete") {
			cin >> x;
			deleteKey(x);
		}
		else if (cmd == "deleteFirst") {
			deleteFirst();
		}
		else if (cmd == "deleteLast") {
			deleteLast();
		}
	}

	printList();



	return 0;
}

Compiler output:
a.cc: In function 'void insert(int)':
a.cc:65:44: error: expected primary-expression before ')' token
   65 |         node *t = (node*)malloc(sizeof node);
      |                                            ^
a.cc: In function 'node* searchList(int)':
a.cc:57:1: warning: control reaches end of non-void function [-Wreturn-type]
   57 | }
      | ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stack>
#include<vector>
#include<cmath>
#include<string>
#include<queue>
#include<map>
#include<cstring>
#include<sstream>
#include<vector>
#include<algorithm>
#include<functional>
#include<set>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<time.h>
typedef long long ll;
using namespace std;

struct node {
	int key;
	node *next, *prev;
};

node *nil;

void init() {
	nil = (node*)malloc(sizeof(node));
	nil->next = nil;
	nil->prev = nil;
}

void deleteNode(node *t) {
	if (t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst() {
	deleteNode(nil->next);
}

void deleteLast() {
	deleteNode(nil->prev);
}

node* searchList(int x) {
	for (node* temp = nil->next; temp != nil; temp = temp->next) {
		if (temp->key == x) {
			return temp;
		}
	}
}

void deleteKey(int key) {
	node* t = searchList(key);
	deleteNode(t);
}

void insert(int key) {
	node *t = (node*)malloc(sizeof node);
	t->key = key;
	t->next = nil->next;
	t->prev = nil;
	nil->next->prev = t;
	nil->next = t;
}

void printList() {
	node *t = nil->next;
	int i = 0;
	while (t != nil) {
		if (i < 1) {
			i++;
			cout << t->key;
			t = t->next;
			continue;
		}
		
		cout << ' ' << t->key;
		t = t->next;
	}
}

int main() {
	//freopen("run.in", "r", stdin);
	//freopen("run.out", "w", stdout);

	init();
	string cmd;
	int n;
	cin >> n;
	int x;
	for (int i = 0; i < n; i++) {
		cin >> cmd;
		if (cmd == "insert") {
			cin >> x;
			insert(x);
		}
		else if (cmd == "delete") {
			cin >> x;
			deleteKey(x);
		}
		else if (cmd == "deleteFirst") {
			deleteFirst();
		}
		else if (cmd == "deleteLast") {
			deleteLast();
		}
	}

	printList();
	cout << endl;


	return 0;
}

Compiler output:
a.cc: In function 'void insert(int)':
a.cc:65:44: error: expected primary-expression before ')' token
   65 |         node *t = (node*)malloc(sizeof node);
      |                                            ^
a.cc: In function 'node* searchList(int)':
a.cc:57:1: warning: control reaches end of non-void function [-Wreturn-type]
   57 | }
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<string>

struct Node{
	int key;
	Node *next,*prev;
};

Node *nil;

Node* listSearch(int key){
	Node *cur = nil->next;	// ??????????¬????????´?????????????
	while(cur != nil && cur ->key!=key){
		cur =cur-> next;
	}
	return cur;
}

//????????? next??¨prev??????????????????
void init(){
	nil=(Node *)malloc(sizeof(Node));
	nil ->next=nil;
	nil ->prev =nil;
}

void printList(){
	Node *cur = nil->next;
	int isf=0;
	while(1){
		if(cur==nil)break;
		if(isf++>0)printf(" ");
		printf("%d", cur -> key);
		cur = cur->next;
	}
	printf("\n");
}

void deleteNode(Node *t){
	if(t==nil)return;	//t??????????????´?????????????????????
	t->prev->next=t->next;
	t->next->prev=t->prev;
	free(t);
}

void deleteFirst(){
	deleteNode(nil->next);
}

void deleteLast(){
	deleteNode(nil->prev);
}

void deleteKey(int key){
	//????´¢????????????????????????
	deleteNode(listSearch(key));
}

void insert(int key){
	Node *x=(Node *)malloc(sizeof(Node));
	x->key=key;
	//???????????´??????????´??????????
	x->next=nil->next;
	nil->next->prev=x;
	nil->next=x;
	x->prev=nil;
}

int main(){
	int key,n,i;
	int size=0;
	char com[20];
	int np=0,nd=0;
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",com,&key);	//?????????????????\?????¢??°
		if(com[0]=='i'){insert(key); np++; size++; }
		else if(com[0]=='d'){
			if(strlen(com)>6){
				if(com[6]=='F')deleteFirst();
				else if(com[6]=='L')deleteLast();
			}
			else{
				deleteKey(key); nd++;
			}
			size--;
		}
	}
	
	printList();
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:28: error: 'strlen' was not declared in this scope
   80 |                         if(strlen(com)>6){
      |                            ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<string>
  +++ |+#include <cstring>
    4 |
Language: C++

#include<cstdio>
#include<cstdlib>
#include<string>
#include<stdlib>

struct Node{
	int key;
	Node *next,*prev;
};

Node *nil;

Node* listSearch(int key){
	Node *cur = nil->next;	// ??????????¬????????´?????????????
	while(cur != nil && cur ->key!=key){
		cur =cur-> next;
	}
	return cur;
}

//????????? next??¨prev??????????????????
void init(){
	nil=(Node *)malloc(sizeof(Node));
	nil ->next=nil;
	nil ->prev =nil;
}

void printList(){
	Node *cur = nil->next;
	int isf=0;
	while(1){
		if(cur==nil)break;
		if(isf++>0)printf(" ");
		printf("%d", cur -> key);
		cur = cur->next;
	}
	printf("\n");
}

void deleteNode(Node *t){
	if(t==nil)return;	//t??????????????´?????????????????????
	t->prev->next=t->next;
	t->next->prev=t->prev;
	free(t);
}

void deleteFirst(){
	deleteNode(nil->next);
}

void deleteLast(){
	deleteNode(nil->prev);
}

void deleteKey(int key){
	//????´¢????????????????????????
	deleteNode(listSearch(key));
}

void insert(int key){
	Node *x=(Node *)malloc(sizeof(Node));
	x->key=key;
	//???????????´??????????´??????????
	x->next=nil->next;
	nil->next->prev=x;
	nil->next=x;
	x->prev=nil;
}

int main(){
	int key,n,i;
	int size=0;
	char com[20];
	int np=0,nd=0;
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",com,&key);	//?????????????????\?????¢??°
		if(com[0]=='i'){insert(key); np++; size++; }
		else if(com[0]=='d'){
			if(strlen(com)>6){
				if(com[6]=='F')deleteFirst();
				else if(com[6]=='L')deleteLast();
			}
			else{
				deleteKey(key); nd++;
			}
			size--;
		}
	}
	
	printList();
	
	return 0;
}

Compiler output:
a.cc:4:9: fatal error: stdlib: No such file or directory
    4 | #include<stdlib>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
	int key;
	Node *next, *prev;
};

Node *nil;

Node* listSearch(int key){
	Node *cur = nil->next;
	while(cur != nil && cur->key != key){
		cur = cur-> next;
	}
	return cur;
}

void init(){
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void printList(){
	Node *cur = nil->next;
	int isf = 0;
	while( 1 ){
		if(cur == nil) break;
		if(isf++ > 0) printf(" ");
		printf("%d", cur->key);
		cur = cur->next);
	}
	printf("\n");
}

void deleteNode(Node *t){
	if(t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst(){
	deleteNode(nil->next);
}

void deleteLast(){
	deleteNode(nil->prev);
}

void deleteKey(){
	deleteNode(listSearch(key));
}

void insert(int key){
	Node *x = (Node *)malloc(sizeof(Node));
	x->next = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

int main(){
	int key, n , i;
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	scanf("%d",&n);
	init();
	for(i = 0; i<n; i++){
		scanf("%s%d",com,&key);
		if(com[0] == 'i'){ insert(key); np++; size++; }
		else if(com[0] == 'd'){
			if(strlen(com) > 6){
				if(com[6] == 'F') deleteFirst();
				else if( com[6] == 'L') deleteLast();
			}else{
				deleteKey(key); nd++;
			}
			size--;
		}
	}
	
	printList();
	
	return 0;
}

Compiler output:
a.cc: In function 'void printList()':
a.cc:33:32: error: expected ';' before ')' token
   33 |                 cur = cur->next);
      |                                ^
      |                                ;
a.cc: In function 'void deleteKey()':
a.cc:54:31: error: 'key' was not declared in this scope; did you mean 'key_t'?
   54 |         deleteNode(listSearch(key));
      |                               ^~~
      |                               key_t
a.cc: In function 'void insert(int)':
a.cc:59:19: error: invalid conversion from 'int' to 'Node*' [-fpermissive]
   59 |         x->next = key;
      |                   ^~~
      |                   |
      |                   int
a.cc: In function 'int main()':
a.cc:81:42: error: too many arguments to function 'void deleteKey()'
   81 |                                 deleteKey(key); nd++;
      |                                 ~~~~~~~~~^~~~~
a.cc:53:6: note: declared here
   53 | void deleteKey(){
      |      ^~~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
	int key;
	Node *next,*prev;
};

Node *nil;

Node* listSearch(int key){
	Node *cur=nil->next;
	while(cur!=nil && cur->key!=key){
		cur=cur->next;
	}
	return cur;
}

void init(){
	nil=(Node *)malloc(sizeof(Node));
	nil->next=nil;
	nil->prev=nil;
}

void printList(){
	Node *cur=nil->next;
	int isf=0;
	while(1){
		if(cur==nil)break;
		if(isf++>0)printf(" ");
		printf("%d",cur->key);
		cur=cur->next;
	}
	printf("\n");
}

void deleteNode(Node *t){
	if(t==nil)return;
	t->prov->next=t->next;
	t->next->prev=t->prev;
	free(t);
}

void deleteFirst(){
	deleteNode(nil->next);
}

void deleteLast(){
	
	deleteNode(nil->prev);
}

void deleteKey(int key){
	deleteNode(listSearch(key));
}

void insert(int key){
	Node *x=(Node *)malloc(sizeof(Node));
	x->key=key;
	
	x->next=nil->next;
	nil->next->prev=x;
	nil->next=x;
	x->prev=nil;
}

int main(){
	int key,n,i;
	int size=0;
	char com[20];
	int np=0,nd=0;
	scanfr("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",com,&key);
		if(com[0]=='i'){insert(key);np++;size++;}
		else if(com[0]--'d'){
			if(strlen(com)>6){
				if(com[6]=='F')deleteFirst();
				else if(com[6]=='L')deleteLast();
			}else{
				deleteKey(key);nd++;
			}
			size--;
		}
	}
	
	printlist();
	
	return 0;
}

Compiler output:
a.cc: In function 'void deleteNode(Node*)':
a.cc:40:12: error: 'struct Node' has no member named 'prov'; did you mean 'prev'?
   40 |         t->prov->next=t->next;
      |            ^~~~
      |            prev
a.cc: In function 'int main()':
a.cc:73:9: error: 'scanfr' was not declared in this scope; did you mean 'scanf'?
   73 |         scanfr("%d",&n);
      |         ^~~~~~
      |         scanf
a.cc:78:33: error: expected ')' before 'd'
   78 |                 else if(com[0]--'d'){
      |                        ~        ^~~
      |                                 )
a.cc:89:9: error: 'printlist' was not declared in this scope; did you mean 'printList'?
   89 |         printlist();
      |         ^~~~~~~~~
      |         printList