criyle/codenet-compile-errors huggingface dataset:
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->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 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<list>
#include<algorithm>
using namespace std;

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


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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: 'strlen' was not declared in this scope
   24 |       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<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

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


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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: 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<algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
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(int Key){
	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 deleteKey(int)':
a.cc:54:31: error: 'key' was not declared in this scope; did you mean 'Key'?
   54 |         deleteNode(listSearch(key));
      |                               ^~~
      |                               Key
a.cc: In function 'void insert(int)':
a.cc:59:19: error: invalid conversion from 'int' to 'Node*' [-fpermissive]
   59 |         x->next = key;
      |                   ^~~
      |                   |
      |                   int
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(int key){
	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 insert(int)':
a.cc:59:19: error: invalid conversion from 'int' to 'Node*' [-fpermissive]
   59 |         x->next = key;
      |                   ^~~
      |                   |
      |                   int
Language: C++

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

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

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

void printList()
{
	Node *cur = nil->next;
	int isf = 0;
	while(1)
	{
		if(cur == nil) break;
		if(ist++ > 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));
}


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--;
		}
	}
	
	printLast();
	return 0;
}

Compiler output:
a.cc: In function 'void printList()':
a.cc:47:20: error: 'ist' was not declared in this scope; did you mean 'isf'?
   47 |                 if(ist++ > 0) printf(" ");
      |                    ^~~
      |                    isf
a.cc: In function 'int main()':
a.cc:108:9: error: 'printLast' was not declared in this scope; did you mean 'printList'?
  108 |         printLast();
      |         ^~~~~~~~~
      |         printList
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(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(void) {
  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->next;
  free(t);
}

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

void deleteLast(void) {
  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(void) {
  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[0] == '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:99:2: error: expected '}' at end of input
   99 | }
      |  ^
a.cc:69:16: note: to match this '{'
   69 | int main(void) {
      |                ^
Language: C++

#include<cstdio>
#include<cstdilib>
#include<cstring>

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

Node *nil;

Node* listSearch(int key){
	Node *cur = nil ->next;
	while(cur != && 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(){
	delelteNode(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(srtrlen(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:2:9: fatal error: cstdilib: No such file or directory
    2 | #include<cstdilib>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio.h>
#include <cstdlib.h>
#include <cstring.h>


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(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(void) {
  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->next;
  free(t);
}

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

void deleteLast(void) {
  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(void) {
  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[0] == 'F') {
      		deleteFirst();
      	}else if(com[6] == 'L') {
      		deleteLast();
      } else {
        deleteKey(key); nd++;
      }
      size--;
    }    
  }
  
  printList();
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: cstdio.h: No such file or directory
    1 | #include <cstdio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio.h>
#include <cstdlib.h>
#include <cstring.h>


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(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(void) {
  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->next;
  free(t);
}

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

void deleteLast(void) {
  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(void) {
  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[0] == 'F') {
      		deleteFirst();
      	}else if(com[6] == 'L') {
      		deleteLast();
      } else {
        deleteKey(key); nd++;
      }
      size--;
    }    
  }
  
  printList();
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: cstdio.h: No such file or directory
    1 | #include <cstdio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
using namespace std;
template<class T>
class node {
public:
	T *data=new T;
	node<T> *pre;
	node<T> *next;
	node(){
		pre = next = NULL;
		*data = 0;
	}
	node(T x) {
		pre = next = NULL;
		*data = x;
	}
	~node() {
		delete data;
	}
};
template<class T>
class List {
public:
	node<T> *data = new node<T>;
	List(){
		data->next = data->pre = data;
	}
	void push_front(T key) {
		node<T> *x = new node<T>(key);
		x->next = data->next;
		data->next->pre = x;
		data->next = x;
		x->pre = data;
	}
	node<T>* find(T x) {
		node<T> *p = data->next;
		while (p != data&&*(p->data) != x) {//?指?和尾指? 都是data
			p = p->next;
		}
		return p;
	}
	void _delete(T x) {
		node<T> *p = find(x);
		p->pre->next = p->next;
		p->next->pre = p->pre;
		delete p;
	}
	void _delete(node<T> *p) {
		p->pre->next = p->next;
		p->next->pre = p->pre;
		delete p;
	}
	void pop_front() {
		_delete(data->next);
	}
	void pop_back() {
		_delete(data->pre);
	}
};
int main() {
//	freopen("input.txt", "r", stdin);
	int n;
	scanf("%d", &n);
	List<int> lt;
	while (n--) {
		char str[20];
		int key;
		scanf("%s", str);
		int len = strlen(str);
		if (len == 6)scanf("%d", &key);
		if (str[0] == 'd') {
			if (len == 6) {
				lt._delete(key);
			}  
			else {
				if (str[6] == 'F') {
					lt.pop_front();
				}
				else if (str[6] == 'L') {
					lt.pop_back();
				}
			}
		}
		else {		
			lt.push_front(key);
		}
	}
	node<int> *p;
	for (p = lt.data->next; p != lt.data; p = p->next) {
		printf("%d ", *(p->data));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:27: error: 'strlen' was not declared in this scope
   72 |                 int len = strlen(str);
      |                           ^~~~~~
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 | #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 inint(){
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) print(" ");
printf("%d",cur->key);
cur=cur->next;


}
printf("\n");
}

void deleteNode(Node *t){
if(t==null) 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(listSerch(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:8:6: error: expected initializer before '*' token
    8 | Node *nil;
      |      ^
a.cc:9:6: error: expected unqualified-id before '?' token
    9 | Node*???listSearch(int key){
      |      ^
a.cc: In function 'void inint()':
a.cc:20:1: error: 'nil' was not declared in this scope
   20 | nil=(Node *)malloc(sizeof(Node));
      | ^~~
a.cc: In function 'void printList()':
a.cc:26:12: error: 'nil' was not declared in this scope
   26 | Node *cur =nil->next;
      |            ^~~
a.cc:30:13: error: 'print' was not declared in this scope; did you mean 'printf'?
   30 | if(isf++>0) print(" ");
      |             ^~~~~
      |             printf
a.cc: In function 'void deleteNode(Node*)':
a.cc:40:7: error: 'null' was not declared in this scope
   40 | if(t==null) return;
      |       ^~~~
a.cc: In function 'void deleteFirst()':
a.cc:48:12: error: 'nil' was not declared in this scope
   48 | deleteNode(nil->next);
      |            ^~~
a.cc: In function 'void deleteLast()':
a.cc:52:12: error: 'nil' was not declared in this scope
   52 | deleteNode(nil->prev);
      |            ^~~
a.cc: In function 'void deleteKey(int)':
a.cc:55:12: error: 'listSerch' was not declared in this scope
   55 | deleteNode(listSerch(key));
      |            ^~~~~~~~~
a.cc: In function 'void insert(int)':
a.cc:60:9: error: 'nil' was not declared in this scope
   60 | x->next=nil->next;
      |         ^~~
a.cc: In function 'int main()':
a.cc:73:1: error: 'init' was not declared in this scope; did you mean 'int'?
   73 | init();
      | ^~~~
      | int
a.cc:90:1: error: 'deletekey' was not declared in this scope; did you mean 'deleteKey'?
   90 | deletekey(key);
      | ^~~~~~~~~
      | 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;
  nli->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->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key, n, i, size=0, np=0, nd=0;
  char com[20];

  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') deleteFirdt();
	else if(com[6] == 'L') deleteLast();
      } else {
	deleteKey(key);
	nd++;
      }
      size--;
    }
  }
    printList();
    return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:23:3: error: 'nli' was not declared in this scope; did you mean 'nil'?
   23 |   nli->prev = nil;
      |   ^~~
      |   nil
a.cc: In function 'int main()':
a.cc:79:27: error: 'deleteFirdt' was not declared in this scope; did you mean 'deleteFirst'?
   79 |         if(com[6] == 'F') deleteFirdt();
      |                           ^~~~~~~~~~~
      |                           deleteFirst
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;
    }
}

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(key){
    Node *x = (Node*)malloc(sizeof(Node));
    x->key = key;
    x->next = nil->key;
    x->prev = nil;
    nil->next->prev = x;
    nil->next = x;
}

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:58:6: error: variable or field 'insert' declared void
   58 | void insert(key){
      |      ^~~~~~
a.cc:58:13: error: 'key' was not declared in this scope; did you mean 'key_t'?
   58 | void insert(key){
      |             ^~~
      |             key_t
a.cc: In function 'int main()':
a.cc:77:13: error: 'insert' was not declared in this scope
   77 |             insert(key);
      |             ^~~~~~
a.cc:90:31: error: 'Key' was not declared in this scope; did you mean 'key'?
   90 |                     deleteKey(Key);nd++
      |                               ^~~
      |                               key
a.cc:90:40: error: expected ';' before '}' token
   90 |                     deleteKey(Key);nd++
      |                                        ^
      |                                        ;
   91 |                 }
      |                 ~
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;
    }
}

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->key;
    x->prev = nil;
    nil->next->prev = x;
    nil->next = x;
}

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 insert(int)':
a.cc:61:20: error: invalid conversion from 'int' to 'Node*' [-fpermissive]
   61 |     x->next = nil->key;
      |               ~~~~~^~~
      |                    |
      |                    int
a.cc: In function 'int main()':
a.cc:90:31: error: 'Key' was not declared in this scope; did you mean 'key'?
   90 |                     deleteKey(Key);nd++;
      |                               ^~~
      |                               key
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;
    }
}

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 (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:97:2: error: expected '}' at end of input
   97 | }
      |  ^
a.cc:67:11: note: to match this '{'
   67 | int main(){
      |           ^
Language: C++

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

//
class Node {
private:
	int key;
	Node *p_next = NULL;
	Node *p_prev = NULL;
public:
	Node(int k);
	void linkNext(Node *n);
	void linkPrev(Node *n);
	Node *getNext();
	Node *getPrev();
	bool hasKey(int k);
	void printKey();
};

Node::Node(int k)
{
	key = k;
}

void Node::linkNext(Node *p_n)
{
	p_next = p_n;
}

void Node::linkPrev(Node *p_n)
{
	p_prev = p_n;
}

Node *Node::getNext()
{
	return p_next;
}

Node *Node::getPrev()
{
	return p_prev;
}

bool Node::hasKey(int k)
{
	return key == k;
}

void Node::printKey()
{
	cout << key;
}

//
class LinkedList {
private:
	Node *p_dummy;
	void linkNode(Node *p_n1, Node *p_n2);
public:
	LinkedList();
	void insertNode(int x);
	void deleteNode(int x);
	void deleteFirst();
	void deleteLast();
	void print();
};

LinkedList::LinkedList()
{
	Node n(-1);
	n.linkNext(&n);
	n.linkPrev(&n);
	p_dummy = &n;
}

void LinkedList::linkNode(Node *p_n1, Node *p_n2)
{
	(*p_n1).linkNext(p_n2);
	(*p_n2).linkPrev(p_n1);
}

void LinkedList::insertNode(int x)
{
	Node n(x);
	linkNode(&n, (*p_dummy).getNext());
	linkNode(p_dummy, &n);
}

void LinkedList::deleteNode(int x)
{
	Node *p_n = (*p_dummy).getNext();
	while (!(*p_n).hasKey(x)) {
		if ((*p_n).hasKey(-1)) return;
		p_n = (*p_n).getNext();
	}
	
	linkNode((*p_n).getPrev(), (*p_n).getNext());
}

void LinkedList::deleteFirst()
{
	linkNode(p_dummy, (*p_dummy).getNext()->getNext());
}

void LinkedList::deleteLast()
{
	linkNode((*p_dummy).getPrev()->getPrev(), p_dummy);
}

void LinkedList::print()
{
	Node *p_n = (*p_dummy).getNext();
	if ((*p_n).hasKey(-1)) return;
	while (1) {
		(*p_n).printKey();
		p_n = (*p_n).getNext();
		if ((*p_n).hasKey(-1)){
			cout << endl;
			break;
		} else {
			cout << " ";
		}
	}
}

//
int main(void)
{	
	LinkedList list;
	
	int n;
	cin >> n;
	
	for (int i = 0; i < n; i++) {
		char command[12] = "\0";
		cin >> command;
		if (strcmp(command, "insert") == 0) {
			int key;
			cin >> key;
			list.insertNode(key);
		} else if (strcmp(command, "delete") == 0) {
			int key;
			cin >> key
			list.deleteNode(key);
		} else if (strcmp(command, "deleteFirst") == 0) {
			list.deleteFirst();
		} else {
			list.deleteLast();
		}
	}

	list.print();
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:146:35: error: expected ';' before 'list'
  146 |                         cin >> key
      |                                   ^
      |                                   ;
  147 |                         list.deleteNode(key);
      |                         ~~~~
Language: C++

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

#define N 2000000

struct link{
	int key;
	struct link *back,*next;
};

struct link *nil;

void init(){
	nil = (struct link *)malloc(sizeof(struct link));
	nil->back = nil;
	nil->next = nil;
}

void insert(int key){
	struct link *node = (struct link *) malloc(sizeof(struct link));
	node->key = key;
	node->next = nil->next;
	nil->next= node;
	node->back = nil;
}

struct link * search(int key){
	struct link *t = nil->next;
	while(t->key != key)t = t->next;
	return t;
}

void delete(int key){
	struct link *x = search(key);
	x->back->next = x->next;
	x->next->back = x->back;
	free(x);
}

void print(){
	struct link *x;
	x = nil->next;
	while(1){
		if(x->next == nil){
			printf("%d",x->key);
			break;
		}
		printf("%d ",x->key);
		x = x->next;
	}
	printf("\n");
}

int main(){
	int key;
	int n,i;
	char ins[7];
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",ins,&key);
		if(!strcmp(ins,"insert")){
			insert(key);
		}
		else if(!strcmp(ins,"delete")) delete(key);
		print();
	}
	print();
	return 0;
}

Compiler output:
a.cc:34:6: error: expected unqualified-id before 'delete'
   34 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:66:55: error: type 'int' argument given to 'delete', expected pointer
   66 |                 else if(!strcmp(ins,"delete")) delete(key);
      |                                                      ~^~~~
Language: C++

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

#define N 2000000
void init();
void insert(int);
struct link * search(int);
void delete(int);
void print();

struct link{
	int key;
	struct link *back,*next;
};

struct link *nil;

void init(){
	nil = (struct link *)malloc(sizeof(struct link));
	nil->back = nil;
	nil->next = nil;
}

void insert(int key){
	struct link *node = (struct link *) malloc(sizeof(struct link));
	node->key = key;
	node->next = nil->next;
	nil->next= node;
	node->back = nil;
}

struct link * search(int key){
	struct link *t = nil->next;
	while(t->key != key)t = t->next;
	return t;
}

void delete(int key){
	struct link *x = search(key);
	x->back->next = x->next;
	x->next->back = x->back;
	free(x);
}

void print(){
	struct link *x;
	x = nil->next;
	while(1){
		if(x->next == nil){
			printf("%d",x->key);
			break;
		}
		printf("%d ",x->key);
		x = x->next;
	}
	printf("\n");
}

int main(){
	int key;
	int n,i;
	char ins[7];
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",ins,&key);
		if(!strcmp(ins,"insert")){
			insert(key);
		}
		else if(!strcmp(ins,"delete")) delete(key);
		print();
	}
	print();
	return 0;
}

Compiler output:
a.cc:9:6: error: expected unqualified-id before 'delete'
    9 | void delete(int);
      |      ^~~~~~
a.cc:39:6: error: expected unqualified-id before 'delete'
   39 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:71:55: error: type 'int' argument given to 'delete', expected pointer
   71 |                 else if(!strcmp(ins,"delete")) delete(key);
      |                                                      ~^~~~
Language: C++

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

#define N 2000000

void init();
void insert(int);
struct link * search(int);
void delete(int);
void print();

struct link{
	int key;
	struct link *back,*next;
};

struct link *nil;

void init(){
	nil = (struct link *)malloc(sizeof(struct link));
	nil->back = nil;
	nil->next = nil;
}

void insert(int key){
	struct link *node = (struct link *) malloc(sizeof(struct link));
	node->key = key;
	node->next = nil->next;
	nil->next= node;
	node->back = nil;
}

struct link * search(int key){
	struct link *t = nil->next;
	while(t->key != key)t = t->next;
	return t;
}

void delete(int key){
	struct link *x = search(key);
	x->back->next = x->next;
	x->next->back = x->back;
	free(x);
}

void print(){
	struct link *x;
	x = nil->next;
	while(1){
		if(x->next == nil){
			printf("%d",x->key);
			break;
		}
		printf("%d ",x->key);
		x = x->next;
	}
	printf("\n");
}

int main(){
	int key;
	int n,i;
	char ins[7];
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",ins,&key);
		if(!strcmp(ins,"insert")){
			insert(key);
		}
		else if(!strcmp(ins,"delete")){
			delete(key);
		}
	}
	print();
	return 0;
}

Compiler output:
a.cc:10:6: error: expected unqualified-id before 'delete'
   10 | void delete(int);
      |      ^~~~~~
a.cc:40:6: error: expected unqualified-id before 'delete'
   40 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:73:32: error: type 'int' argument given to 'delete', expected pointer
   73 |                         delete(key);
      |                               ~^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
#define MAX 100000
 
struct list{
  int key;
  struct list *next,*back;
};
 
struct list *nil;
 
struct list* search(int key){
  struct list *x = nil->next;
  while(x!=nil && x->key!=key) x = x->next;
  return x;
}
 
void init(){
  struct list *x = (struct list *)malloc(sizeof(struct list));
  x->next = x;
  x->back = x;
}
 
void print(){
  struct list *x = nil->next;
  while(1){
    if(x == nil) break;
    printf("%d ", x->key);
    x = x->next;
  }
  printf("\n");
}
 
void insert(int key){
  struct list *x = (struct list *)malloc(sizeof(struct list));
  x->key = key;
  x->next = nil->next;
  nil->next->back = x;
  nil->next = x;
  x->back = nil;
}
 
void delete(struct list *x){
  if(x ==nil) return;
  x->back->next = x->next;
  x->next->back = x->back;
  free(x);
}
 
int main(){
 
  int key, n, i, size = 0, np = 0, nd = 0;
  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') delete(nil->next);
        else if(com[6] == 'L') delete(nil->back);
      }else {
        delete(search(key));
      }
    }
  }
 
  print();
 
  return 0;
}

Compiler output:
a.cc:45:6: error: expected unqualified-id before 'delete'
   45 | void delete(struct list *x){
      |      ^~~~~~
Language: C++

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

#define N 2000000

void init();
void insert(int);
struct link * search(int);
void delete(struct link *);
void print();

struct link{
	int key;
	struct link *back,*next;
};

struct link *nil;

void init(){
	nil = (struct link *)malloc(sizeof(struct link));
	nil->next = nil;
	nil->back = nil;
}

void insert(int key){
	struct link *node = (struct link *) malloc(sizeof(struct link));
	node->key = key;

	node->next = nil->next;
	nil->next->back = node;
	nil->next= node;
	node->back = nil;
}

struct link * search(int key){
	struct link *t = nil->next;
	while(t->key != key || t != nil)
		{t = t->next;}
	return t;
}

void delete(struct link *x){
	printf("7");
	if(x==nil) return;
	x->back->next = x->next;
	x->next->back = x->back;
	free(x);
}

void print(){
	struct link *x;
	x = nil->next;
	while(1){
		if(x == nil){
			break;
		}
		printf("%d ",x->key);
		x = x->next;
	}
	printf("\n");
}

int main(){
	int key;
	int n,i;
	char ins[20];
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++){
		scanf("%s%d",ins,&key);
		if(!strcmp(ins,"insert")){
			insert(key);
		}
		else if(ins[0]== 'd'){
			if(strlen(ins) > 6){
				if(ins[6] == 'F'){
					delete(nil->next);
				}
				else if(ins[6] == 'L'){
					delete(nil->back);
				}
			}
			else{
				delete(search(key));
			}
		}

	}
	print();
	return 0;
}

Compiler output:
a.cc:10:6: error: expected unqualified-id before 'delete'
   10 | void delete(struct link *);
      |      ^~~~~~
a.cc:43:6: error: expected unqualified-id before 'delete'
   43 | void delete(struct link *x){
      |      ^~~~~~
Language: C++

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

struct list{
    int key;
    struct list *next,*back;
};

struct list *list;
 
struct list * search(int key){
    struct list *x = list->next;
    while(x!=list && x->key!=key) x = x->next;
    return x;
}

void init(){
    list = (struct list *)malloc(sizeof(struct list));
    list->next = list;
    list->back = list;
}

void print(){
    struct list *x = list->next;
    int i = 0;
    while(1){
       if(x == list) break;
       if(i++ > 0) printf(" ");
        printf("%d", x->key);
        x = x->next;
    }
    printf("\n");
}

void insert(int key){
    struct list *x = (struct list *)malloc(sizeof(struct list));
    x->key = key;
    x->next = list->next;
    list->next->back = x;
    list->next = x;
    x->back = list;
}

void delete(struct list *x){
    if(x == list) return;
    x->back->next = x->next;
    x->next->back = x->back;
    free(x);
}

int main(){
    int key, n, i;
    char ins[20];
    scanf("%d", &n);
    init();
 
    for(i = 0; i < n; i++){
      scanf("%s %d", ins, &key);
      if(ins[0] == 'i'){
          insert(key);
      }
      else if(ins[0] == 'd'){
          if(strlen(ins) > 6){
              if(ins[6] == 'F') delete(list->next);
              else if(ins[6] == 'L') delete(list->back);
          }else {
              delete(search(key));
          }
      }
    }
    print();
    return 0;
}

Compiler output:
a.cc:45:6: error: expected unqualified-id before 'delete'
   45 | void delete(struct list *x){
      |      ^~~~~~
Language: C++

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

struct Node {
  int key;
  struct Node *prev, *next;
};  
struct Node *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;
  
}

void init() {
  nil = (struct Node *)malloc(sizeof(struct Node));
  nil->next = nil;
  nil->prev = nil;
}
  
void insert(int key) {
  struct Node *x = (struct Node *)malloc(sizeof(struct Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}
  
struct Node* listSearch(int key) {
  struct Node *cur = nil->next;
  while(cur != nil && cur->key != key ) {
    cur = cur-> next;
  }
  return cur;
}
  
void deleteNode(struct 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 printList() {
  struct Node *cur;
  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:17:3: error: 'init' was not declared in this scope; did you mean 'int'?
   17 |   init();
      |   ^~~~
      |   int
a.cc:21:7: error: 'insert' was not declared in this scope
   21 |       insert(key);
      |       ^~~~~~
a.cc:27:11: error: 'deleteFirst' was not declared in this scope
   27 |           deleteFirst();
      |           ^~~~~~~~~~~
a.cc:29:11: error: 'deleteLast' was not declared in this scope
   29 |           deleteLast();
      |           ^~~~~~~~~~
a.cc:32:9: error: 'deleteKey' was not declared in this scope
   32 |         deleteKey(key);
      |         ^~~~~~~~~
a.cc:38:3: error: 'printList' was not declared in this scope
   38 |   printList();
      |   ^~~~~~~~~
Language: C++

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

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

Node *nil;

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

void init(void){
  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;
  int np=0,nd=0;
  char com[20];

  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 deleteKey(int)':
a.cc:55:14: error: 'listSearch' was not declared in this scope; did you mean 'listsearch'?
   55 |   deleteNode(listSearch(key));
      |              ^~~~~~~~~~
      |              listsearch