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

#include<iostream>
#include<vector>
#include<string>
#include<unordered_set>
#include<list>
using namespace std;

int main() {
	list<int>a;
	int b;
	cin >> b;
	for (int c = 0; c < b; c++) {
		string d;
		cin >> d;
		if (d == "insert") {
			int e;
			cin >> e;
			a.push_front(e);
		}
		else if (d == "deleteFirst")a.pop_front();
		else if (d == "deleteFirst")a.pop_back();
		else {
			int g;
			cin >> g;
			auto h = find(a.begin(), a.end(), g);
			if (h != a.end())a.erase(h);
		}
	}
	for (auto k = a.begin(); k != a.end(); k++) {
		cout << (*k) << "|";
	}
	printf("\b\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:38: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
   25 |                         auto h = find(a.begin(), a.end(), g);
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:25:38: note:   'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   25 |                         auto h = find(a.begin(), a.end(), g);
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<unordered_set>
#include<list>
#include<stdio.h>
using namespace std;

int main() {
	list<int>a;
	int b;
	cin >> b;
	for (int c = 0; c < b; c++) {
		string d;
		cin >> d;
		if (d == "insert") {
			int e;
			cin >> e;
			a.push_front(e);
		}
		else if (d == "deleteFirst")a.pop_front();
		else if (d == "deleteFirst")a.pop_back();
		else {
			int g;
			cin >> g;
			auto h = find(a.begin(), a.end(), g);
			if (h != a.end())a.erase(h);
		}
	}
	for (auto k = a.begin(); k != a.end(); k++) {
		cout << (*k) << "|";
	}
	printf("\b\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:38: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
   26 |                         auto h = find(a.begin(), a.end(), g);
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:26:38: note:   'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   26 |                         auto h = find(a.begin(), a.end(), g);
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
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->pre=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->next->prev=t->prev;
    t->prev->next=t->next;
    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->next=nil->next;
    nil->next->prev=x;
    nil->next-x;
    x->prev=nil;
}
int main()
{
    int key,n,i;
    char com[20];
    scanf("%d",&n);
    init();
    for(i=0;i<n;i++)
    {
        scanf("%s%d",com,&key);
        if(com[0]=='i')
        {
            Insert(key);
           
        }
        else if(com[0]=='d')
        {
            if(strlen(com)>6)
            {
                if(com[6]=='F')
                    deleteFirst();
                else if(com[6]=='L')
                    deleteLast();
            }
            else
            {
                deleteKey(key);
               
            }
            
        }
    }
    printList();
    return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:23:10: error: 'struct Node' has no member named 'pre'; did you mean 'prev'?
   23 |     nil->pre=nil;
      |          ^~~
      |          prev
a.cc: In function 'int main()':
a.cc:81:16: error: 'strlen' was not declared in this scope
   81 |             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<cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>

using namespace std;

int main(void) {

	int q, x;
	char com[20];

	list<int> v;

	scanf_s("%d", &q);
	for (int i = 0; i < q; 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++) printf(" ");
		printf("%d", *it);
	}
	cout << endl;
	return 0;
}

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

#include <stdio.h>
#include <string.h>
#include <stdlib.h> 
struct Node
{
    int value;
    Node *prev,*next;
};
/*void init()*/
//{
    //node = (Node *)malloc(sizeof(Node));
    //node->prev = node;
    //node->prev = node;
    //return;
/*}*/
void insert(Node *head, int val)
{
    Node *node = (Node *)malloc(sizeof(Node));
    node->value = val;
    node->next = head->next;
    node->prev = head;
    head->next->prev = node;
    head->next = node;
} 
Node *listSearch(Node *head, int val)
{
    Node *cur = head->next;
    while(cur!=NULL && cur->value!=val)
    {
        cur = cur->next;
    }
    return cur;
}
void deleteNode(Node *node)
{
    if(node==NULL) return;
    node->prev->next = node->next;
    node->next->prev = node->prev;
    free(node);
    return;
}
void deleteFirst(Node *head)
{
    deleteNode(head->next);
    return;
}
void deleteLast(Node *head)
{
    deleteNode(head->prev);        
    return;
}

void print(Node *head)
{
    Node *cur = head->next;
    while(cur!=head)
    {

        printf("%d",cur->value);
        cur = cur->next;
        if (cur==head) break;
        printf(" ");
    }
    printf("\n");
    return;
}

int main()
{
    int n;
    char com[20];
    int val;
    Node *node;
    node = (Node *)malloc(sizeof(Node));
    node->prev = node;
    node->next = node;
    scanf("%d",&n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s %d",com,&val);
        if (com[0]=='i')
        { 
            insert(node, val); 
        } else if (com[0]=='d')
        { 
            if (strlen(com)>6)
            { 
                if (com[6]=='F')
                { 
                    deleteFirst(nodet); 
                }else if (com[6]=='L')
                {
                    deleteLast(node);
                }
            } else
            {
                deleteNode(listSearch(node,val));
            }
        }
    }
    print(node);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:33: error: 'nodet' was not declared in this scope; did you mean 'node'?
   90 |                     deleteFirst(nodet);
      |                                 ^~~~~
      |                                 node
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct Node{
  int x;
  struct Node *prev;
  struct Node *next;
};

void insert(int);
void delete(int);
void deleteFirst();
void deleteLast();
void display();
void release();

struct Node head;

int main(void){
  int n;
  char input[20];
  int inputx;

  head.prev = &head;
  head.next = &head;

  scanf("%d", &n);

  while((scanf("%s", input)) != EOF){
    if(strcmp(input, "insert") == 0){
      scanf("%d", &inputx);
      insert(inputx);
    }else if(strcmp(input, "delete") == 0){
      scanf("%d", &inputx);
      delete(inputx);
    }else if(strcmp(input, "deleteFirst") == 0){
      deleteFirst();
    }else if(strcmp(input, "deleteLast") == 0){
      deleteLast();
    }else if(strcmp(input, "display") == 0){
      display();
    }
  }
  release();
  return 0;
}

void insert(int input){
  struct Node *p, *prev, *next;

  p = (struct Node *)malloc(sizeof(struct Node));

  prev = &head;
  next = head.next;
  p->x = input;
  p->prev = prev;
  p->next = next;
  next->prev = p;
  prev->next = p;

  //printf("insert %d\n", input);
}

void delete(int input){
  struct Node *p, *prev;

  prev = &head;

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

          //printf("delete %d\n", input);
          free(p);
          return;
        }

        prev->next = &head;
        head.prev = prev;
        //printf("delete %d\n", input);
        free(p);
        return;
      }

      prev = p;
    }
  }
}

void deleteFirst(){
  struct Node *p, *prev;

  prev = &head;
  p = head.next;
  prev->next = p->next;
  p->next->prev = prev;

  //printf("deleteFirst\n");
  free(p);
  return;
}

void deleteLast(){
  struct Node *p, *prev;

  if(head.next == &head){
    return;
  }

  p = head.prev;
  prev = p->prev;
  prev->next = &head;
  head.prev = prev;

  //printf("deleteLast\n");
  free(p);
  return;
}

void display(){
  struct Node *p;

  if(head.next == &head) return;

  for(p = head.next; p != &head; p=p->next){
    printf("%d ", p->x);
  }
  printf("\n");
}

void release(){
  struct Node *next, *del;

  next = head.next;

  display();
  while(next != &head){
    del = next;
    next = next->next;

    free(del);
  }
}

Compiler output:
a.cc:12:6: error: expected unqualified-id before 'delete'
   12 | void delete(int);
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:36:14: error: type 'int' argument given to 'delete', expected pointer
   36 |       delete(inputx);
      |             ~^~~~~~~
a.cc: At global scope:
a.cc:65:6: error: expected unqualified-id before 'delete'
   65 | void delete(int input){
      |      ^~~~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct Node{
  int x;
  struct Node *prev;
  struct Node *next;
};

void insert(int);
void delete(int);
void deleteFirst();
void deleteLast();
void display();
void release();

struct Node head;

int main(void){
  int n;
  char input[20];
  int inputx;

  head.prev = &head;
  head.next = &head;

  scanf("%d", &n);

  while((scanf("%s", input)) != EOF){
    if(strcmp(input, "insert") == 0){
      scanf("%d", &inputx);
      insert(inputx);
    }else if(strcmp(input, "delete") == 0){
      scanf("%d", &inputx);
      delete(inputx);
    }else if(strcmp(input, "deleteFirst") == 0){
      deleteFirst();
    }else if(strcmp(input, "deleteLast") == 0){
      deleteLast();
    }else if(strcmp(input, "display") == 0){
      display();
    }
  }
  release();
  return 0;
}

void insert(int input){
  struct Node *p, *prev, *next;

  p = (struct Node *)malloc(sizeof(struct Node));

  prev = &head;
  next = head.next;
  p->x = input;
  p->prev = prev;
  p->next = next;
  next->prev = p;
  prev->next = p;

  //printf("insert %d\n", input);
}

void delete(int input){
  struct Node *p, *prev;

  prev = &head;

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

          //printf("delete %d\n", input);
          free(p);
          return;
        }

        prev->next = &head;
        head.prev = prev;
        //printf("delete %d\n", input);
        free(p);
        return;
      }

      prev = p;
    }
  }
}

void deleteFirst(){
  struct Node *p, *prev;

  prev = &head;
  p = head.next;
  prev->next = p->next;
  p->next->prev = prev;

  //printf("deleteFirst\n");
  free(p);
  return;
}

void deleteLast(){
  struct Node *p, *prev;

  if(head.next == &head){
    return;
  }

  p = head.prev;
  prev = p->prev;
  prev->next = &head;
  head.prev = prev;

  //printf("deleteLast\n");
  free(p);
  return;
}

void display(){
  struct Node *p;

  if(head.next == &head) return;

  for(p = head.next; p->next != &head; p=p->next){
    printf("%d ", p->x);
  }
  printf("%d", p->x);
  printf("\n");
}

void release(){
  struct Node *next, *del;

  next = head.next;

  display();
  while(next != &head){
    del = next;
    next = next->next;

    free(del);
  }
}

Compiler output:
a.cc:12:6: error: expected unqualified-id before 'delete'
   12 | void delete(int);
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:36:14: error: type 'int' argument given to 'delete', expected pointer
   36 |       delete(inputx);
      |             ~^~~~~~~
a.cc: At global scope:
a.cc:65:6: error: expected unqualified-id before 'delete'
   65 | void delete(int input){
      |      ^~~~~~
Language: C++

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

int main(void){
    int q, x;
    char com[20];
    list<int> v;
    scans("%d", &q);
    for(i=0;i<q;i++){
        scanf("%s", com);
        num = com[7];
        if(com[0]=='i'){
            scans("%d", &x);
            v.push_front(x);
        }
        else if(com[6]=='L'){
            v.pop_back();
        }
        else if(com[6]=='F'){
            l.pop_front();
        }
        else if(com[0]=='d'){
            scanf("%d", &x);
            for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
                if(*itr==x){
                    v.erase(itr);
                    break;
                }
            }
        }
    }
    //out put
    for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
        cout << *itr << ' ';
    }
    cout << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'scans' was not declared in this scope; did you mean 'scanf'?
   11 |     scans("%d", &q);
      |     ^~~~~
      |     scanf
a.cc:12:9: error: 'i' was not declared in this scope
   12 |     for(i=0;i<q;i++){
      |         ^
a.cc:14:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |         num = com[7];
      |         ^~~
      |         enum
a.cc:23:13: error: 'l' was not declared in this scope
   23 |             l.pop_front();
      |             ^
Language: C++

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

int main(void){
    int i, q, x;
    char com[20];
    list<int> v;
    scans("%d", &q);
    for(i=0;i<q;i++){
        scanf("%s", com);
        num = com[7];
        if(com[0]=='i'){
            scanf("%d", &x);
            v.push_front(x);
        }
        else if(com[6]=='L'){
            v.pop_back();
        }
        else if(com[6]=='F'){
            l.pop_front();
        }
        else if(com[0]=='d'){
            scanf("%d", &x);
            for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
                if(*itr==x){
                    v.erase(itr);
                    break;
                }
            }
        }
    }
    //out put
    for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
        cout << *itr << ' ';
    }
    cout << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'scans' was not declared in this scope; did you mean 'scanf'?
   11 |     scans("%d", &q);
      |     ^~~~~
      |     scanf
a.cc:14:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |         num = com[7];
      |         ^~~
      |         enum
a.cc:23:13: error: 'l' was not declared in this scope
   23 |             l.pop_front();
      |             ^
Language: C++

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

int main(void){
    int i, q, x;
    char com[20];
    list<int> v;
    scanf("%d", &q);
    for(i=0;i<q;i++){
        scanf("%s", com);
        num = com[7];
        if(com[0]=='i'){
            scanf("%d", &x);
            v.push_front(x);
        }
        else if(com[6]=='L'){
            v.pop_back();
        }
        else if(com[6]=='F'){
            l.pop_front();
        }
        else if(com[0]=='d'){
            scanf("%d", &x);
            for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
                if(*itr==x){
                    v.erase(itr);
                    break;
                }
            }
        }
    }
    //out put
    for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
        cout << *itr << ' ';
    }
    cout << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |         num = com[7];
      |         ^~~
      |         enum
a.cc:23:13: error: 'l' was not declared in this scope
   23 |             l.pop_front();
      |             ^
Language: C++

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

int main(void){
    int i, q, x;
    char com[20];
    list<int> v;
    scanf("%d", &q);
    for(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 itr=v.begin(); itr!=v.end(); itr++){
                if(*itr==x){
                    v.erase(itr);
                    break;
                }
            }
        }
    }
    //out put
    int i=0;
    for(list<int>::iterator itr=v.begin(); itr!=v.end(); itr++){
        if(i++) printf(" "); 
        printf("%d", *itr);
    }
    printf("\n");

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: redeclaration of 'int i'
   34 |     int i=0;
      |         ^
a.cc:7:9: note: 'int i' previously declared here
    7 |     int i, q, x;
      |         ^
Language: C++

#include <iostream>
#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:13:31: error: expected ';' before ')' token
   13 |     for (int i = 0; i < q, i++){
      |                               ^
      |                               ;
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
struct node {
	int key;
	node *pre, *nex;
};
node *nil;
void init() {
	nil = (node *)malloc(sizeof(node));
	nil->nex = nil;
	nil->pre = nil;
}
void insert(int key) {
	node *a = (node*)malloc(sizeof(node));
	a ->key = key;
	a->nex = nil->nex;
	nil->nex->pre = a;
	nil->nex = a;
	a->pre = nil;
}
node* search(int key) {
	node *cur;
	cur = nil->nex;
	while (cur != nil && cur->key != key) {
		cur = cur->nex;
	}
	return cur;
}
void deletenode(node *pt) {
	/*if (pt != nil) {
		pt->nex->pre = pt->pre;
		pt->pre->nex = pt->nex;
		free(pt);
	}
	else return;*/
	if (pt == nil) return;
	pt->nex->pre = pt->pre;
	pt->pre->nex = pt->nex;
	free(pt);
}
void deleteFirst() {
	deletenode(nil->nex);
}
void deleteLast() {
	deletenode(nil->pre);
}
void deletekey(int key) {
	deletenode(search(key));
}
void printNode() {
	node *cur = nil->nex;
	/*while (cur != nil) {
		printf("%d", cur->key);
		cur = cur->nex;
	}*/
	int i = 0;
	while (1) {
		if(cur == nil)break;
		if (i++ > 0) printf(" ");
		printf("%d", cur->key);
		cur = cur->nex;
	}
	printf("\n");
}
int main() {
	int n, key;
	char com[15];
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s%d", com, &key);
		if (com[0] == 'i') {
			insert(key);
		}
		/*else if (com[6] == 'F') {
			deleteFirst();
		}
		else if (com[6] == 'L') {
			deleteLast();
		}
		else {
			deletekey(key);
		}*/
		else if (com[0] == 'd') {
			if (strlen(com) > 6) {
				if (com[6] == 'F') {
					deleteFirst();
				}
				else if (com[6] == 'L') {
					deleteLast();
				}
				else {
					deletekey(key);
			}

		}
	}
	printNode();
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:101:18: error: expected '}' at end of input
  101 |         return 0;
      |                  ^
a.cc:72:37: note: to match this '{'
   72 |         for (int i = 0; i < n; i++) {
      |                                     ^
a.cc:101:18: error: expected '}' at end of input
  101 |         return 0;
      |                  ^
a.cc:68:12: note: to match this '{'
   68 | int main() {
      |            ^
Language: C++

define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
struct node {
	int key;
	node *pre, *nex;
};
node *nil;
void init() {
	nil = (node *)malloc(sizeof(node));
	nil->nex = nil;
	nil->pre = nil;
}
void insert(int key) {
	node *a = (node*)malloc(sizeof(node));
	a ->key = key;
	a->nex = nil->nex;
	nil->nex->pre = a;
	nil->nex = a;
	a->pre = nil;
}
node* search(int key) {
	node *cur;
	cur = nil->nex;
	while (cur != nil && cur->key != key) {
		cur = cur->nex;
	}
	return cur;
}
void deletenode(node *pt) {
	/*if (pt != nil) {
		pt->nex->pre = pt->pre;
		pt->pre->nex = pt->nex;
		free(pt);
	}
	else return;*/
	if (pt == nil) return;
	pt->nex->pre = pt->pre;
	pt->pre->nex = pt->nex;
	free(pt);
}
void deleteFirst() {
	deletenode(nil->nex);
}
void deleteLast() {
	deletenode(nil->pre);
}
void deletekey(int key) {
	deletenode(search(key));
}
void printNode() {
	node *cur = nil->nex;
	/*while (cur != nil) {
		printf("%d", cur->key);
		cur = cur->nex;
	}*/
	int i = 0;
	while (1) {
		if(cur == nil)break;
		if (i++ > 0) printf(" ");
		printf("%d", cur->key);
		cur = cur->nex;
	}
	printf("\n");
}
int main() {
	int size = 0, np = 0, nd = 0;
	int n, key;
	char com[15];
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s%d", com, &key);
		if (com[0] == 'i') {
			insert(key); np++; size++;
		}
		/*else if (com[6] == 'F') {
			deleteFirst();
		}
		else if (com[6] == 'L') {
			deleteLast();
		}
		else {
			deletekey(key);
		}*/
		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--;

			}
		}
		printNode();
		return 0;
	}
}

Compiler output:
a.cc:1:1: error: 'define' does not name a type
    1 | define _CRT_SECURE_NO_WARNINGS
      | ^~~~~~
Language: C++

import sys
from collections import deque
n = int(input())
q = deque()
for i in range(n):
    c = input()
    if c[0] == 'i':
        q.appendleft(c[7:])
    elif c[6] == ' ':
        try:
            q.remove(c[7:])
        except:
            pass
    elif c[6] == 'F':
        q.popleft()
    else:
        q.pop()
print(*q)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

from collections import deque
n = int(input())
q = deque()
for i in range(n):
    c = input()
    if c[0] == 'i':
        q.appendleft(c[7:])
    elif c[6] == ' ':
        try:
            q.remove(c[7:])
        except:
            pass
    elif c[6] == 'F':
        q.popleft()
    else:
        q.pop()
print(*q)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
using namespace std;

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

typedef struct Node Node;

Node* nil;

// Inirialize the list
void initialize()
{
	nil = new Node;
	nil->key = -999999;
	nil->next = nil;
	nil->prev = nil;
}

// Insert the key
void insert(int key)
{
	// Make new node
	Node* x = new Node;
	x->key = key;

	// Insert the new node
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

// Search the node by given key
Node* search(int key)
{
	Node* current;
	current = nil->next;
	while (current != nil && current->key != key) {
		current = current->next;
	}
	return current;
}

// Delete the node
void delete_node(Node* node)
{
	node->prev->next = node->next;
	node->next->prev = node->prev;
	delete node;
}

// Delete x
void delete_x(int x)
{
	Node* n = search(x);
	delete_node(n);
}

// Delete first
void delete_first()
{
	delete_node(nil->next);
}

// Delete last
void delete_last()
{
	delete_node(nil->prev);
}


int main()
{
	initialize();
	int n;
	scanf_s("%d", &n);
	char operation[50];

	int x;
	for (int i = 0; i < n; i++) {
		scanf_s("%s", operation,50);
		if (strcmp("insert",operation) == 0) {
			scanf_s("%d", &x);
			insert(x);
		}
		else if (strcmp("delete",operation) == 0) {
			scanf_s("%d", &x);
			delete_x(x);
		}
		else if (strcmp("deleteFirst",operation) == 0) {
			delete_first();
		}
		else {
			delete_last();
		}
	}

	// Print all keys of lists
	Node* current;
	current = nil->next;
    if(current != nil) {
		cout << current->key;
		current = current->next;
	}
	while (current != nil) {
		cout << ' ' << current->key;
		current = current->next;
	}
	cout << endl;
	return 0;
}

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

#include <iostream>
using namespace std;
struct Node
{
	int key;//??°?????¬????????´??°key
	Node *next, *prev;//???????????????????´??????????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()
{
	//malloc???C????¨?????????????????????°?????¨?????¨?????????????????§?°???????????????´???sizeof???Node????????????Node?±???????????????´?????§?°?
	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)
			cout << " ";
		cout << cur->key;//?????°????????????
		cur = cur->next;//?????????????????????
	}
	cout << endl;
}
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;//n???????????°
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	cin >> n;
	init();
	for (int i = 0; i < n; i++)
	{
		cin >> 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:87:29: error: 'strlen' was not declared in this scope
   87 |                         if (strlen(com) > 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 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
struct Node
{
	int key;//??°?????¬????????´??°key
	Node *next, *prev;//???????????????????´??????????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()
{
	//malloc???C????¨?????????????????????°?????¨?????¨?????????????????§?°???????????????´???sizeof???Node????????????Node?±???????????????´?????§?°?
	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)
			cout << " ";
		cout << cur->key;//?????°????????????
		cur = cur->next;//?????????????????????
	}
	cout << endl;
}
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;//n???????????°
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	cin >> n;
	init();
	for (int i = 0; i < n; i++)//????????????????°±???????¬???????
	{
		cin >> 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:87:29: error: 'strlen' was not declared in this scope
   87 |                         if (strlen(com) > 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 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
struct Node
{
	int key;//??°?????¬????????´??°key
	Node *next, *prev;//???????????????????´??????????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()
{
	//malloc???C????¨?????????????????????°?????¨?????¨?????????????????§?°???????????????´???sizeof???Node????????????Node?±???????????????´?????§?°?
	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)
			cout << " ";
		cout << cur->key;//?????°????????????
		cur = cur->next;//?????????????????????
	}
	cout << endl;
}
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;//n???????????°
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	cin >> n;
	init();
	for (int i = 0; i < n; i++)//????????????????°±???????¬???????
	{
		cin >> com;
		if (com[0] == 'i')
		{
			cin >> key;
			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
			{
				cin >> key;
				deleteKey(key); 
				nd++;
			}
			size--;
		}
	}
	printList();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:29: error: 'strlen' was not declared in this scope
   88 |                         if (strlen(com) > 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 | using namespace std;
Language: C++

#include <cstdio>
#include <string>
#include <list>
#include <algorithm>

int main() {

    const int BUF_SIZE = 21;

    int commandCount;
    std::scanf("%d\n", &commandCount);

    std::list<int> list;
    while (commandCount--) {
        char command[BUF_SIZE];
        std::gets(command);
        std::string command_str(command);

        if (command_str.substr(0, 6) == "insert") {
            int value = std::stoi(command_str.substr(7));
            list.emplace_front(value);
        } else if (command_str.substr(0, 11) == "deleteFirst") {
            list.pop_front();
        } else if (command_str.substr(0, 11) == "deleteLast") {
            list.pop_back();
        } else if (command_str.substr(0, 6) == "delete") {
            int value = std::stoi(command_str.substr(7));
            const auto deleteItr = std::find(list.begin(), list.end(), value);
            if (deleteItr != list.end()) {
                list.erase(deleteItr);
            }
        }
    }

    auto itr = list.cbegin();
    const auto endItr = list.cend();
    std::printf("%d", *itr);
    for (++itr; itr != endItr; ++itr) {
        std::printf(" %d", *itr);
    }
    std::puts("");

    return 0;

}

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

def operation(command, arrey):
    if command[0] == 'insert':
        arrey.insert(0,command[1])
        return arrey
    elif command[0] == 'delete':
        if command[1] in arrey:
            arrey.remove(command[1])
    elif command[0] == 'deleteFirst':
        arrey.pop(0)
    elif command[0] == 'deleteLast':
        arrey.pop(-1)


n = int(input())
list = []

for i in range(n):
    command = input().split()
    operation(command,list)

for i in range(len(list)):
    print(list[i]) if i == len(list)-1 else print(list[i]+' ',end='')

Compiler output:
a.cc:2:22: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
    2 |     if command[0] == 'insert':
      |                      ^~~~~~~~
a.cc:5:24: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
    5 |     elif command[0] == 'delete':
      |                        ^~~~~~~~
a.cc:8:24: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
    8 |     elif command[0] == 'deleteFirst':
      |                        ^~~~~~~~~~~~~
a.cc:10:24: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   10 |     elif command[0] == 'deleteLast':
      |                        ^~~~~~~~~~~~
a.cc:22:67: error: empty character constant
   22 |     print(list[i]) if i == len(list)-1 else print(list[i]+' ',end='')
      |                                                                   ^~
a.cc:1:1: error: 'def' does not name a type
    1 | def operation(command, arrey):
      | ^~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <list>
#include<string>
using namespace std;

int main()
{
	list<int> lst;
	int n,comn;
	char com[20];
	
	//??????????????°??????
	scanf("%d", &n);

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

	}

	if (!lst.empty()){
		for (list<int>::iterator it = lst.begin(); it != lst.end(); it++){
			printf("%d ", *it);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: 'strlen' was not declared in this scope
   25 |                         if (strlen(com) == 6){
      |                             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <list>
  +++ |+#include <cstring>
    5 | #include<string>
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->key;
	}
	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(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;
	char s[20];
	scanf("%d", &n);
	init();
	for (i = 0; i < n; i++) {
		scanf("%s%d", s, &key);
		if (s[0] == 'i') {
			insert(key);
		}
		else if (s[0] == 'd') {
			if (strlen(s) > 6) {
				if (s[6] == 'f') {
					deletefirst;
				}
				else if (s[6] == 'l') {
					deletelast;
				}
			}
			else deletekey(key);
		}
	}
	printlist();
    return 0;
}

Compiler output:
a.cc: In function 'void printlist()':
a.cc:37:28: error: invalid conversion from 'int' to 'Node*' [-fpermissive]
   37 |                 cur = cur->key;
      |                       ~~~~~^~~
      |                            |
      |                            int
Language: C++

#include "bits/stdc++.h"
using namespace std;

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(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 (int 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:72:33: error: expected primary-expression before '>' token
   72 |                 if(strlen(com)==>6){
      |                                 ^
Language: C++

#include<iostream>
#include<list>
#include<string>
using namespace std;
int main(){
	list<int>l;
	int n; scanf_s("%d", &n);
	for (int i = 0; i < n; i++){
		string s; scanf_s("%s", s);
		if (s == "deleteFirst")l.pop_front();
		else if (s == "deleteLast")l.pop_back();
		else if (s == "insert") {
			int k; scanf_s("%d", &k);
			l.push_front(k);
		}
		else if (s == "delete") {
			int k; scanf_s("%d", &k);
			for (list<int>::iterator i = l.begin(); i != l.end(); i++){
				if (*i == k) {
					l.erase(i);
					break;
				}
			}
		}
	}
	int c = 0;
	for (auto i = l.begin(); i != l.end();i++) {
		if (c++)cout << ' ';
		cout << *i;
	}
	cout << endl;
}

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

#include<iostream>
#include<list>
#include<string>
using namespace std;
int main(){
	list<int>l;
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		string s; scanf_s("%s", s);
		if (s == "deleteFirst")l.pop_front();
		else if (s == "deleteLast")l.pop_back();
		else if (s == "insert") {
			int k; scanf_s("%d", &k);
			l.push_front(k);
		}
		else if (s == "delete") {
			int k; scanf_s("%d", &k);
			for (list<int>::iterator i = l.begin(); i != l.end(); i++){
				if (*i == k) {
					l.erase(i);
					break;
				}
			}
		}
	}
	int c = 0;
	for (auto i = l.begin(); i != l.end();i++) {
		if (c++)cout << ' ';
		cout << *i;
	}
	cout << endl;
}

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

#include<stdio.h>
#include<algorithm>
#include<iostream>

using namespace std;

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

Node *nil;

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

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;
}

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;
	free(t);
}

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

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

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

int main(){
	int n,d;
	char com[20];
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%s %d", com, &d);
		if (com[0] == 'i'){
			insert(key);

		}
		else if (com[0] == 'd'){
			if (strlen(com)>6){
				if (com[6] == 'F')deleteFirst();
				else if (com[6] == 'L')deleteLast();
			}
			else{
				deleteKey(key);
			}
		}
	}
	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");
}

Compiler output:
a.cc: In function 'Node* listSearch(int)':
a.cc:32:30: error: expected ';' before '}' token
   32 |                 cur=cur->next
      |                              ^
      |                              ;
   33 |         }
      |         ~                     
a.cc: In function 'int main()':
a.cc:63:32: error: 'key' was not declared in this scope; did you mean 'key_t'?
   63 |                         insert(key);
      |                                ^~~
      |                                key_t
a.cc:67:29: error: 'strlen' was not declared in this scope
   67 |                         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<iostream>
  +++ |+#include <cstring>
    4 | 
a.cc:72:43: error: 'key' was not declared in this scope; did you mean 'key_t'?
   72 |                                 deleteKey(key);
      |                                           ^~~
      |                                           key_t
Language: C++

#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>

using namespace std;

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

Node *nil;

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

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;
}

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;
	free(t);
}

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

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

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

int main(){
	int n,d;
	char com[20];
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%s %d", com, &d);
		if (com[0] == 'i'){
			insert(key);

		}
		else if (com[0] == 'd'){
			if (strlen(com)>6){
				if (com[6] == 'F')deleteFirst();
				else if (com[6] == 'L')deleteLast();
			}
			else{
				deleteKey(key);
			}
		}
	}
	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");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:32: error: 'key' was not declared in this scope; did you mean 'key_t'?
   64 |                         insert(key);
      |                                ^~~
      |                                key_t
a.cc:68:29: error: 'strlen' was not declared in this scope
   68 |                         if (strlen(com)>6){
      |                             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<stdlib.h>
  +++ |+#include <cstring>
    5 | 
a.cc:73:43: error: 'key' was not declared in this scope; did you mean 'key_t'?
   73 |                                 deleteKey(key);
      |                                           ^~~
      |                                           key_t