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

#include<stdio.h>
#include <iostream>
#include <string.h>
#include <cstdlib>
 
using namespace std;
 
#define BUF_SIZE 1024
 
struct Node{
    int data;
    Node* prev;
    Node* next;
};
 
class ConnectedList{
public:
    ConnectedList(){
        motherNode = new Node();
        motherNode->data = -1;
        motherNode->prev = motherNode;   
        motherNode->next = motherNode;
    };
    ~ConnectedList(){
        Node* tmpNode = motherNode->next;
        Node* nextNode;
        while(tmpNode != motherNode){
            nextNode = tmpNode->next;
            delete tmpNode;
            tmpNode = nextNode;
        }
        delete motherNode;
    };
    void insertNode(int x){
        Node* tmpNode = motherNode->next;
        motherNode->next = new Node();
        motherNode->next->data = x;
        motherNode->next->next = tmpNode;
        motherNode->next->prev = motherNode;
        tmpNode->prev = motherNode->next;
    };
    void deleteNode(int x){
        Node* tmpNode = motherNode->next;
        while(tmpNode != motherNode && tmpNode->data != x){
            tmpNode = tmpNode->next;
        }
        if(tmpNode != motherNode){  
            tmpNode->prev->next = tmpNode->next;
            tmpNode->next->prev = tmpNode->prev;
            delete tmpNode;
        }
    };
 
    void deleteFirst(){
        Node* tmpNode = motherNode->next;
        motherNode->next = motherNode->next->next;
        motherNode->next->prev = motherNode;
        delete tmpNode; 
    };
 
    void deleteLast(){
        Node* tmpNode = motherNode->prev;
        motherNode->prev = motherNode->prev->prev;
        motherNode->prev->next = motherNode;
        delete tmpNode; 
    };
 
    void showList(){
        Node* tmpNode = motherNode->next;
        printf("%d",tmpNode->data);
        tmpNode = tmpNode->next;
        while(tmpNode != motherNode){
            printf(" %d",tmpNode->data);
            tmpNode = tmpNode->next;
        }
        printf("\n");
    }
 
private:
    Node* motherNode;
};
 
 
int main(){
 
    char buf[BUF_SIZE];
    int n = atoi(fgets(buf,BUF_SIZE,stdin));
 
    ConnectedList list;
 
    for(int i = 0; i < n; i++){
 
        fgets(buf,BUF_SIZE,stdin);
 
        if(buf[6] == 'F'){
            list.deleteFirst();
        }else if(buf[6] == 'L'){
            list.deleteLast();
        }else{
            int S = 0;
             
            if(buf[0] == 'i'){  //insert x
 
                for(int i = 0; buf[i] != '\0';i++){
                    if(buf[i] >= '0' && buf[i] <= '9'){
                        S = 10*S + (buf[i] - '0');
                    }
                }
                list.insertNode(S);
            }else{  
                for(int i = 0;buf[i] != '\0';i++){
                    if(buf[i] >= '0' && buf[i] <= '9'){
                        S = 10*S + (buf[i] - '0');
                    }
                }
                list.deleteNode(S);
            }
 
        }
 
    }
 
    list.showList();
 
}

Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
  
 int main()
{
  int n, w, i, j, y=0, f, g, h;
  scanf("%d", &n);
  int data[n];
  char c[12];
 
  for(i=0;i<n;i++){
    scanf("%s %d", c, &w);
 
    if(c[0] == 'i'){
      data[i]=w;
    }
 
    else if(c[6] == 'F'){
      i-=2;
      n-=2;
    }
 
    else if(c[6] == 'L'){
      i--;
      r--;
      y++;
    }
 
    else{
      i--;
      n--;
      f=0;
      for(j = i; j >= 0; j--){
 
    if(f>0)break;
 
    if(w == data[j]){
      h = 0;
      g = i-j;
      f++;
      while(g!=h++)
	x[j + h - 1]=x[j + 1 + h - 1];
      i--;n--;
    }
      }
    }
  }
  for(i = 0; i < n-y; i++){
    if(i == n-y-1)
      printf("%d\n",data[n-1-i]);
    else
      printf("%d ",data[n-1-i]);
  }
  return 0
    

Compiler output:
main.c: In function 'main':
main.c:24:7: error: 'r' undeclared (first use in this function)
   24 |       r--;
      |       ^
main.c:24:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:41:9: error: 'x' undeclared (first use in this function)
   41 |         x[j + h - 1]=x[j + 1 + h - 1];
      |         ^
main.c:53:11: error: expected ';' at end of input
   53 |   return 0
      |           ^
      |           ;
   54 | 
main.c:53:3: error: expected declaration or statement at end of input
   53 |   return 0
      |   ^~~~~~
Language: C

#include<stdio.h>
  
 int main()
{
  int n, w, i, j, y=0, f, g, h;
  scanf("%d", &n);
  int data[n];
  char c[12];
 
  for(i = 0; i < n; i++){
    scanf("%s %d", c, &w);
 
    if(c[0] == 'i'){
      data[i]=w;
    }
 
    else if(c[6] == 'F'){
      i -= 2;
      n -= 2;
    }
 
    else if(c[6] == 'L'){
      i--;
      n--;
      y++;
    }
 
    else{
      i--;
      n--;
      f=0;
      for(j = i; j >= 0; j--){
 
    if(f > 0) break;
 
    if(w == data[j]){
      h = 0;
      g = i-j;
      f++;
      while(g!=h++)
	data[j + h - 1]=data[j + 1 + h - 1];
      i--;n--;
    }
      }
    }
  }
  for(i = 0; i < n-y; i++){
    if(i == n-y-1)
      printf("%d\n",data[n-1-i]);
    else
      printf("%d ",data[n-1-i]);
  }
  return 0
    

Compiler output:
main.c: In function 'main':
main.c:53:11: error: expected ';' at end of input
   53 |   return 0
      |           ^
      |           ;
   54 | 
main.c:53:3: error: expected declaration or statement at end of input
   53 |   return 0
      |   ^~~~~~
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:
main.c: In function 'main':
main.c:73:5: error: expected declaration or statement at end of input
   73 |     return 0;
      |     ^~~~~~
Language: C

#include<stdio.h>

 int main()
{
  int n, w, i, j, y=0, l, m, k;
  scanf("%d", &n);
  int data[n];
  char c[12];

  for(i = 0; i < n; i++){
    scanf("%s %d", c, &w);

    if(c[0] == 'i'){
      data[i]=w;
    }

    else if(c[6] == 'F'){
      i -= 2;
      n -= 2;
    }

    else if(c[6] == 'L'){
      i--;
      n--;
      y++;
    }

    else{
      i--;
      n--;
      f=0;
      for(j = i; j >= 0; j--){

    if(f > 0) break;

    if(w == data[j]){
      k = 0;
      m = i-j;
      l++;
      while(m!=k++)
    data[j + k - 1]=data[j + 1 + k - 1];
      i--;n--;
    }
      }
    }
  }
  for(i = 0; i < n-y; i++){
    if(i == n-y-1)
      printf("%d\n",data[n-1-i]);
    else
      printf("%d ",data[n-1-i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:7: error: 'f' undeclared (first use in this function)
   31 |       f=0;
      |       ^
main.c:31:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

 int main()
{
  int n, a, i, j, y=0, l, m, k;
  scanf("%d", &n);
  int data[n];
  char c[12];

  for(i = 0; i < n; i++){
    scanf("%s %d", c, &a);

    if(c[0] == 'i'){
      data[i]=w;
    }

    else if(c[6] == 'F')
    {
      i -= 2;

      n -= 2;
    }

    else if(c[6] == 'L')
    {
      i--;

      n--;

      y++;
    }

    else
    {
      i--;
      n--;
      l=0;
      for(j = i; j >= 0; j--){

    if(l > 0) break;

    if(a == data[j]){
      k = 0;
      m = i-j;
      l++;
      while(m!=k++)
    data[j + k - 1]=data[j + 1 + k - 1];
      i--;
      n--;
    }
      }
    }
  }
  for(i = 0; i < n-y; i++){
    if(i == n-y-1)
      printf("%d\n",data[n-1-i]);
    else
      printf("%d ",data[n-1-i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:15: error: 'w' undeclared (first use in this function)
   14 |       data[i]=w;
      |               ^
main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

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

typedef struct node Node;

Node *nil;

void init(){
  nil = (Node *)malloc(sizeof(Node));
  nil->prev = nil;
  nil->next = 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(void){
  int n, i, a, b = 0;
  char s[100];
  scanf("%d",&n);
  init();
  for(i=0;i<n;i++){
    scanf("%s",s);
    if(s[0] == 'd'){
      if(s[6] == 'F') deleteFirst();
      else if(s[6] == 'L') deleteLast();
      else {
        scanf("%d",&a);
        deleteKey(a);
      }
    }
    else {
      scanf("%d",&a);
      insert(a);
      b++;
    }
  }
  printf("%d",nil->next->key);
  Node *c;
  while(c = nil->next;c != nil;c = c->next){
    printf(" %d",c->key);
  }
  printf("\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:78:22: error: expected ')' before ';' token
   78 |   while(c = nil->next;c != nil;c = c->next){
      |        ~             ^
      |                      )
Language: C

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

typedef struct item {
	struct item *next;
	int value;
} item;

int main(void) {
	char s[100];
	int n, val, i, j;
	item *itm, *itm1, *first = NULL;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%s", s);
		itm = first;
		if (strcmp(s, "insert") == 0) {
			scanf("%d", &val);
			itm = calloc(1, sizeof(item));
			itm->value = val;
			itm->next = first;
			first = itm;
		} else if (strcmp(s, "delete") == 0) {
			scanf("%d", &val);
			itm1 = NULL;
			while (itm != NULL && itm->value != val) {
				itm1 = itm;
				itm = itm->next;
			}
			if (itm1 == NULL) {
				first = itm->next;
				free(itm);
			} else if (itm != NULL) {
				itm1->next = itm->next;
				free(itm);
			}
		} else if(strcmp(s, "deleteFirst") == 0) {
			if (itm != NULL) {
				first = itm->next;
				free(itm);
			}
		} else if(strcmp(s, "deleteLast") == 0) {
			itm1 = NULL;
			if (itm != NULL) {
				while (itm->next != NULL) {
					itm1 = itm;
					itm = itm->next;
				}
				if (itm1 == NULL) {
					first = NULL;
				} else {
					itm1->next = NULL;
					free(itm);
				}
			}
		} else printf("invalid %s\n", s);|
		for (itm = first; itm != NULL; itm = itm->next) {
			if (itm != first) printf(" ");
			printf("%d", itm->value);
		}
	printf("\n");
	
}

Compiler output:
main.c: In function 'main':
main.c:57:50: error: expected expression before '|' token
   57 |                 } else printf("invalid %s\n", s);|
      |                                                  ^
main.c:64:1: error: expected declaration or statement at end of input
   64 | }
      | ^
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct node *link;

struct node{
  int item;
  link next;
};

int main(void){
  int n, i, j, getitem, size = 0;
  char s[256];
  link head;
  head = malloc(sizeof(*head));
  head->item = -1;
  head->next = NULL;
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%s", s);
    if(!strcmp(s, "insert")){ //insert
      scanf("%d", &getitem);
      link x;
      x = malloc(sizeof(*x));
      x->item = getitem;
      x->next = head;
      head = x;
      size++;
    }else if(!strcmp(s, "delete")){ //delete
      scanf("%d", &getitem);
      link x;
      x = malloc(sizeof(*x));
      x = head;
      if(head->item == getitem){
	head = head->next;
	size--;
	continue;
      }
      while(x->next->item != -1){
	if(x->next->item == getitem){
	  x->next = x->next->next;
	  size--;
	  break;
	}else{
	  x = x->next;
	}
      }
    }else if(!strcmp(s, "deleteFirst")){ //deleteFirst
      head = head->next;
      size--;
    }else if(!strcmp(s, "deleteLast")){ //deleteLast
      if(size == 0){
	continue;
      }else if(size == 1){
	head = head->next;
	size--;
	continue;
      }
      link x;
      x = malloc(sizeof(*x));
      x = head;
      for(j = 0; j < size-2; j++){
	x = x->next;
      }
      x->next = x->next->next;
      size--;
    }
  }

  
  link x;
  x = malloc(sizeof(*x));
  x = head;

  int ii;
  if(size==200000){
    for(i = 0; i < size; i += 10){
      printf("%d ", x->item);
      printf("%d ", x->next->item);
      printf("%d ", x->next->next->item);
      printf("%d ", x->next->next->next->item);
      printf("%d ", x->next->next->next->next->item);
      printf("%d ", x->next->next->next->next->next->item);
      printf("%d ", x->next->next->next->next->next->next->item);
      printf("%d ", x->next->next->next->next->next->next->next->item);
      printf("%d ", x->next-->next->next->next->next->next->next->next>item);
      printf("%d", x->next->next->next->next->next->next->next->next->next->item);
      if(!(i+10 < size)){
	printf("\n");
	return 0;
      }
      x = x->next->next->next->next->next->next->next->next->next->next;
      printf(" ");
    }
  }
  
  while(!(x->next == NULL)){
    printf("%d", x->item);
    if(x->next->item == -1) break;
    printf(" ");
    x = x->next;
  }
  
  printf("\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:88:31: error: 'next' undeclared (first use in this function)
   88 |       printf("%d ", x->next-->next->next->next->next->next->next->next>item);
      |                               ^~~~
main.c:88:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:88:72: error: 'item' undeclared (first use in this function)
   88 |       printf("%d ", x->next-->next->next->next->next->next->next->next>item);
      |                                                                        ^~~~
Language: C

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

typedef struct DATA{
	int data;
	struct DATA *next;
	struct DATA *before;
}DATA, *link;

link setList(link h){
	h = (link)malloc(sizeof(struct DATA));
	h->next = NULL;
	h->next = NULL;
	h->data = -1;
	return h;
}
link insert(link h,int key){
	link x = (link)malloc(sizeof(struct DATA));
	x->data = key;
	x->before = h;
	if(h->next!=NULL)x->next = h->next;
	else x->next = NULL;
	if(h->next!=NULL)h->next->before = x;
	h->next = x;
	return h;
}
link delete(link h,int data){
	link t = h;
	while(t->next != NULL){
		if(t->next->data == data){			
			t = t->next;
			t->before->next = t->next;
			if(t->next!=NULL)
				t->next->before = t->before;
			free(t);
			break;
		}
		t = t->next;
	}
	return h;
}
link deleteFirst(link h){//
	link t = h->next;
	h->next = t->next;
	t->next->before = h;
	free(t);
	return h;
}
link deleteLast(link h){
	link b,t;
	if(h->next==NULL)return h;
	t = h;
	while(t->next != NULL)t = t->next;
	t->before->next = NULL;
	free(t);
	return h;
}
link deleteAll(link h){
	link t;
	while (h->next != NULL){
		t = h->next;
		h->next = t->next;
		free(t);
	}
	return h;
}
void deleteList(link h){
	deleteAll(h);
	free(h);
	return;
}
void printList(link h){
	link t = h;
		if(t->next->next==NULL)printf("%d\n",t->next->data);
		else printf("%d ",t->next->data);
		if(t->next!=NULL)t = t->next;
	}
	printf("\n");
	return;
}



int main(){
	int i,n,num;
	char command[15];
	link head;
	scanf("%d",&n);
	head = setList(head);
	for(i=0;i<n;i++){
		scanf("%s",&command);
		if(strcmp(command,"insert") == 0){
			scanf("%d",&num);
			head = insert(head,num);
		}else if(strcmp(command,"delete") == 0){
			scanf("%d",&num);
			head = delete(head,num);
		}else if(strcmp(command,"deleteFirst")==0){
			head = deleteFirst(head);
		}else if(strcmp(command,"deleteLast") == 0){
			head = deleteLast(head);
		}
	}
	
	printList(head);
	deleteList(head);
	return 0;
}

Compiler output:
main.c:79:16: error: expected declaration specifiers or '...' before string constant
   79 |         printf("\n");
      |                ^~~~
main.c:80:9: error: expected identifier or '(' before 'return'
   80 |         return;
      |         ^~~~~~
main.c:81:1: error: expected identifier or '(' before '}' token
   81 | }
      | ^
Language: C

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

typedef struct node{
	int num;
	struct node *prev;
	struct node *next;
} List;

List *insert(List *head, int x)
{
	List *p;
	if((p=(List *)malloc(sizeof(List))) == NULL){
		printf("malloc error\n");
		exit(1);
	}
	p->num = x;
	p->prev = NULL;
	p->next=head;
	if(head != NULL) head->prev=p;
	return p;
}

List *deleteFirst(List *head)
{
	List *p;
	if(head==NULL) return head;
	if(head->next == NULL) return NULL
	p=head->next; p->prev=NULL;
	free(head); return p;
}

List *deleteLast(List *head)
{
	List *p=head;
	if(p==NULL) return p;
	if(p->next == NULL){
		free(p); return NULL;
	}
	while(p->next->next != NULL) p = p-> next;
	free(p->next); p->next = NULL;
	return head;
}
List *delete_x(List *head,int x){
	List *p=head;
	if(head->num == x){
		p = deleteFirst(p);
		return p;
	}
	while(p != NULL){
		if(p->num == x){
			p->prev->next = p->next;
			if(p->next != NULL) p->next->prev = p->prev;
			free(p);
			break;
		}
		p = p->next;
	}
	return head;
}



void showAll(List *head){
	List *p=head;
	
	if(p != NULL){
		printf("%d", p->num);
		p = p->next;
	}
	while( p!= NULL){
		printf(" %d", p->num); p=p->next;
	}
	printf("\n");
}

int main(void){
	char com[13];
	int x,n;
	int i;
	List *list=NULL;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s", com);
		if(strcmp( com, "insert") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			list=insert(list,x);
		}
		else if(strcmp( com, "delete") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			list=delete_x(list,x);
		}
		else if(strcmp( com, "deleteFirst") == 0){
			list=deleteFirst(list);
		}
		else if(strcmp( com, "deleteLast") == 0){
			list=deleteLast(list);
		}
	}
	showAll(list);
	return 0;
}

Compiler output:
main.c: In function 'deleteFirst':
main.c:30:9: error: expected ';' before 'p'
   30 |         p=head->next; p->prev=NULL;
      |         ^
Language: C

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

typedef struct node{
	int num;
	struct node *prev;
	struct node *next;
} List;

List *insert(List *head, int x)
{
	List *p;
	if((p=(List *)malloc(sizeof(List))) == NULL){
		printf("malloc error\n");
		exit(1);
	}
	p->num = x;
	p->prev = NULL;
	p->next=head;
	if(head != NULL) head->prev=p;
	return p;
}

List *deleteFirst(List *head)
{
	List *p;
	if(head==NULL) return head;
	if(head->next == NULL) return NULL;
	p=head->next; p->prev=NULL;
	free(head); return p;
}

List *deleteLast(List *head)
{
	List *p=head;
	if(p==NULL) return p;
	if(p->next == NULL){
		free(p); return NULL;
	}
	while(p->next->next != NULL) p = p-> next;
	free(p->next); p->next = NULL;
	return head;
}
List *delete_x(List *head,int x){
	List *p=head;
	if(head->num == x){
		p = deleteFirst(p);
		return p;
	}
	while(p != NULL){
		if(p->num == x){
			p->prev->next = p->next;
			if(p->next != NULL) p->next->prev = p->prev;
			free(p);
			break;
		}
		p = p->next;
	}
	return head;
}

void showAll(List *head){
	List *p=head;
	
	if(p != NULL){
		printf("%d", p->num);
		p = p->next;
	}
	while( p!= NULL){
		printf(" %d", p->num); p=p->next;
	}
	printf("\n");
}

List *head=NULL
List *tail=head

int main(void){
	char com[13];
	int x,n;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s", com);
		if(strcmp( com, "insert") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			list=insert(head,x);
		}
		else if(strcmp( com, "delete") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			list=delete_x(head,x);
		}
		else if(strcmp( com, "deleteFirst") == 0){
			list=deleteFirst(head);
		}
		else if(strcmp( com, "deleteLast") == 0){
			list=deleteLast(head);
		}
	}
	showAll(head);
	return 0;
}

Compiler output:
main.c:77:1: error: expected ',' or ';' before 'List'
   77 | List *tail=head
      | ^~~~
Language: C

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

typedef struct node{
	int num;
	struct node *prev;
	struct node *next;
} List;

List *insert(List *head, int x)
{
	List *p;
	if((p=(List *)malloc(sizeof(List))) == NULL){
		printf("malloc error\n");
		exit(1);
	}
	p->num = x;
	p->prev = NULL;
	p->next=head;
	if(head != NULL) head->prev=p;
	return p;
}

List *deleteFirst(List *head)
{
	List *p;
	if(head==NULL) return head;
	if(head->next == NULL) return NULL;
	p=head->next; p->prev=NULL;
	free(head); return p;
}

List *deleteLast(List *head)
{
	List *p=head;
	if(p==NULL) return p;
	if(p->next == NULL){
		free(p); return NULL;
	}
	while(p->next->next != NULL) p = p-> next;
	free(p->next); p->next = NULL;
	return head;
}
List *delete_x(List *head,int x){
	List *p=head;
	if(head->num == x){
		p = deleteFirst(p);
		return p;
	}
	while(p != NULL){
		if(p->num == x){
			p->prev->next = p->next;
			if(p->next != NULL) p->next->prev = p->prev;
			free(p);
			break;
		}
		p = p->next;
	}
	return head;
}

void showAll(List *head){
	List *p=head;
	
	if(p != NULL){
		printf("%d", p->num);
		p = p->next;
	}
	while( p!= NULL){
		printf(" %d", p->num); p=p->next;
	}
	printf("\n");
}

List *head=NULL;
List *tail=head;

int main(void){
	char com[13];
	int x,n;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s", com);
		if(strcmp( com, "insert") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			list=insert(head,x);
		}
		else if(strcmp( com, "delete") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			list=delete_x(head,x);
		}
		else if(strcmp( com, "deleteFirst") == 0){
			list=deleteFirst(head);
		}
		else if(strcmp( com, "deleteLast") == 0){
			list=deleteLast(head);
		}
	}
	showAll(head);
	return 0;
}

Compiler output:
main.c:77:12: error: initializer element is not constant
   77 | List *tail=head;
      |            ^~~~
main.c: In function 'main':
main.c:91:25: error: 'list' undeclared (first use in this function); did you mean 'List'?
   91 |                         list=insert(head,x);
      |                         ^~~~
      |                         List
main.c:91:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

typedef struct node{
	int num;
	struct node *prev;
	struct node *next;
} List;

List *insert(List *head, int x)
{
	List *p;
	if((p=(List *)malloc(sizeof(List))) == NULL){
		printf("malloc error\n");
		exit(1);
	}
	p->num = x;
	p->prev = NULL;
	p->next=head;
	if(head != NULL) head->prev=p;
	return p;
}

List *deleteFirst(List *head)
{
	List *p;
	if(head==NULL) return head;
	if(head->next == NULL) return NULL;
	p=head->next; p->prev=NULL;
	free(head); return p;
}

List *deleteLast(List *head)
{
	List *p=head;
	if(p==NULL) return p;
	if(p->next == NULL){
		free(p); return NULL;
	}
	while(p->next->next != NULL) p = p-> next;
	free(p->next); p->next = NULL;
	return head;
}
List *delete_x(List *head,int x){
	List *p=head;
	if(head->num == x){
		p = deleteFirst(p);
		return p;
	}
	while(p != NULL){
		if(p->num == x){
			p->prev->next = p->next;
			if(p->next != NULL) p->next->prev = p->prev;
			free(p);
			break;
		}
		p = p->next;
	}
	return head;
}

void showAll(List *head){
	List *p=head;
	
	if(p != NULL){
		printf("%d", p->num);
		p = p->next;
	}
	while( p!= NULL){
		printf(" %d", p->num); p=p->next;
	}
	printf("\n");
}

List *head=NULL;
List *tail=head;

int main(void){
	char com[13];
	int x,n;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s", com);
		if(strcmp( com, "insert") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			head=insert(head,x);
		}
		else if(strcmp( com, "delete") == 0){
			if(scanf("%d", &x) ==  -1){
				printf("No number\n");
				exit(1);
			}
			head=delete_x(head,x);
		}
		else if(strcmp( com, "deleteFirst") == 0){
			head=deleteFirst(head);
		}
		else if(strcmp( com, "deleteLast") == 0){
			head=deleteLast(head);
		}
	}
	showAll(head);
	return 0;
}

Compiler output:
main.c:77:12: error: initializer element is not constant
   77 | List *tail=head;
      |            ^~~~
Language: C

#include<stdipo.h>
#include<stdlib.h>

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

struct node *nil;

void insert(int);
void delete(struct node*);
struct node* search(int);
void listPrint(void);

int main(){
  int n,i,x;
  char str[15];

  scanf("%d",&n);
  nil = (struct node*)malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;

  for(i = 0; i<n;i++){
    scanf("%s",str);
    if(str[0]== 'i'){
      scanf("%d",&x);
      insert(x);
    }else if(str[0]=='d'){
      if(str[6]=='\0'){
        scanf("%d",&x);
        delete(search(x));
      }else if(str[6]=='F'){
        delete(nil->next);
      }else{
        delete(nil->prev);
      }
    }
  }
  listPrint();
  return 0;
}




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

void delete(struct node* delnode){
  if(delnode == nil){;
  }else{
    delnode->prev->next = delnode->next;
    delnode->next->prev = delnode->prev;
    free(delnode);
  }
}

struct node* search(int key){
  struct node* searchnode = nil->next;
  while(searchnode != nil && searchnode->key != key){
    searchnode = searchnode->next;
  }
return searchnode;
}


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

Compiler output:
main.c:1:9: fatal error: stdipo.h: No such file or directory
    1 | #include<stdipo.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
#include <string>
    
class List
{
    int* data_; //[4000000];
    int begin_;
    int end_;
public:
    List()
    {
        data_ = new int[4000000];
        begin_ = 2000000;
        end_  = 2000000;
    }
    // ~List()
    // {
    //     delete[] data_;
    // }
    void Insert(int X)
    {
        --begin_;
        data_[begin_] = X;
    }
    void Delete(int X)
    {
        int Index = end_;
        for(int i = begin_; i < end_; ++i){
            if(X == data_[i]){
                Index = i;
                break;
            }
        }
        if(Index == end_) return;
        for(int i = Index; i < end_; ++i){
            data_[i] = data_[i+1];
        }
        end_--;
    }
    void DeleteFirst()
    {
        begin_++;
    }
    void DeleteLast()
    {
        end_--;
    }
    void Show()const
    {
        printf("%d", data_[begin_]);
        for(int i = begin_ + 1; i < end_; ++i){
            printf(" %d", data_[i]);
        }
        printf("\n");
    }
};
    
int main()
{
    List list;
    int n, X;
    std::scanf("%d\n", &n);
    char com[1024];
    for(int i = 0; i < n; ++i){
        std::fgets(com, 1024, stdin);
        if(com[6] == 'F'){
            list.DeleteFirst();
        }else
        if(com[6] == 'L'){
            list.DeleteLast();
        }else{
            int v = 0;
            for(int j = 7; com[j] >= '0' && com[j] <= '9'; ++j){
                v = v*10 + (com[j] - '0');
            }
            if(com[0] == 'i'){
                list.Insert(v);
            }else
            if(com[0] == 'd'){
                list.Delete(v);
            }
        }
    }
    list.Show();
    return 0;
}

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

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int key;
    struct Node *prev;
	struct Node *next;
};
  
struct Node *note;
  
void insert(int key) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->key = key;
	note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
  
struct Node* listSearch(int key) {
    struct Node *cur = note->next;
    while(cur != note && cur->key != key ) {
        cur = cur-> next;
    }
    return cur;
}
  
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}
  
void deleteFirst() {
    deleteNode(note->next);
}
  
void deleteLast() {
    deleteNode(note->prev);
}
void deleteKey(int key) {
    deleteNode(listSearch(key));
}
  
void printList() {
    struct Node *cur;
    cur = note->next;
    int isf = 0;
  
    while(1) {
        if (cur == note) break;
        if(isf++ > 0) printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
    }
    printf("\n");
}
  
  
int main(void) {
    int key, n;
    char order[20];
    scanf("%d", &n);
    note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &key);
        if(order[0] == 'i') {
            insert(key);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( order[6] == 'F') {
                    deleteFirst();
                }else if(order[6] == 'L') {
                    deleteLast();
                }
            }else {
                deleteKey(key);
            }
        }
    }
    printList();
    return 

Compiler output:
main.c: In function 'main':
main.c:85:5: error: expected expression at end of input
   85 |     return
      |     ^~~~~~
main.c:85:5: error: expected declaration or statement at end of input
Language: C

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int key;
    struct Node *prev;
	struct Node *next;
};
  
struct Node *note;
  
void init() {
    note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;
}
  
void insert(int key) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->key = key;
	note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
  
struct Node* listSearch(int key) {
    struct Node *cur = note->next;
    while(cur != note && cur->key != key ) {
        cur = cur-> next;
    }
    return cur;
}
  
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}
  
void deleteFirst() {
    deleteNode(note->next);
}
  
void deleteLast() {
    deleteNode(note->prev);
}
void deleteKey(int key) {
    deleteNode(listSearch(key));
}
  
void printList() {
    struct Node *cur;
    cur = note->next;
    int isf = 0;
  
    while(1) {
        if (cur == note) break;
        if(isf++ > 0) printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
    }
    printf("\n");
}
  
  
int main(void) {
    int key, n;
    char order[20];
    scanf("%d", &n);
    init();
    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &key);
        if(order[0] == 'i') {
            insert(key);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( order[6] == 'F') {
                    deleteFirst();
                }else if(order[6] == 'L') {
                    deleteLast();
                }
            }else {
                deleteKey(key);
            }
        }
    }
    printList();
    return 

Compiler output:
main.c: In function 'main':
main.c:90:5: error: expected expression at end of input
   90 |     return
      |     ^~~~~~
main.c:90:5: error: expected declaration or statement at end of input
Language: C

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int key;
    struct Node *prev;
	struct Node *next;
};
  
struct Node *note;
  
void insert(int key) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->key = key;
	note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
  
struct Node* listSearch(int key) {
    struct Node *cur = note->next;
    while(cur != note && cur->key != key ) {
        cur = cur-> next;
    }
    return cur;
}
  
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}
  
void deleteFirst() {
    deleteNode(note->next);
}
  
void deleteLast() {
    deleteNode(note->prev);
}
void deleteKey(int key) {
    deleteNode(listSearch(key));
}
  
void printList() {
    struct Node *cur;
    cur = note->next;
    int isf = 0;
  
    while(1) {
        if (cur == note) break;
        if(isf++ > 0) printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
    }
    printf("\n");
}
  
  
int main(void) {
    int key, n;
    char order[20];
    scanf("%d", &n);
	 note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;
    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &key);
        if(order[0] == 'i') {
            insert(key);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( order[6] == 'F') {
                    deleteFirst();
                }else if(order[6] == 'L') {
                    deleteLast();
                }
            }else {
                deleteKey(key);
            }
        }
    }
    printList();
    return 
}

Compiler output:
main.c: In function 'main':
main.c:87:1: error: expected expression before '}' token
   87 | }
      | ^
Language: C

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int key;
    struct Node *prev;
	struct Node *next;
};
  
struct Node *note;
  
void init() {
    note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;
}
  
void insert(int key) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->key = key;
	note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
  
struct Node* listSearch(int key) {
    struct Node *cur = note->next;
    while(cur != note && cur->key != key ) {
        cur = cur-> next;
    }
    return cur;
}
  
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}
  
void deleteFirst() {
    deleteNode(note->next);
}
  
void deleteLast() {
    deleteNode(note->prev);
}
void deleteKey(int key) {
    deleteNode(listSearch(key));
}
  
void printList() {
    struct Node *cur;
    cur = note->next;
    int isf = 0;
  
    while(1) {
        if (cur == note) break;
        if(isf++ > 0) printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
    }
    printf("\n");
}
  
  
int main(void) {
    int key, n;
    char order[20];
    scanf("%d", &n);
    init();
    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &key);
        if(order[0] == 'i') {
            insert(key);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( order[6] == 'F') {
                    deleteFirst();
                }else if(order[6] == 'L') {
                    deleteLast();
                }
            }else {
                deleteKey(key);
            }
        }
    }
    printList();
    return 
}

Compiler output:
main.c: In function 'main':
main.c:91:1: error: expected expression before '}' token
   91 | }
      | ^
Language: C

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int va;
    struct Node *prev;
    struct Node *next;
};
   
struct Node *note;
   
void insert(int va) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->va = va;
    note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
   
   
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
}
 void deleteva(int va) {
    deleteNode(search(va));
}  
void deleteFirst() {
    deleteNode(note->next);
}
   
void deleteLast() {
    deleteNode(note->prev);
}

 struct Node* search(int va) {
    struct Node *x = note->next;
    while(x != note && x->va != va ) {
        x = x-> next;
    }
    return x;
}  
void print() {
    struct Node *x;
    x = note->next;
    int i = 0;
    while(1) {
        if (x == note) break;
    	if(i++ > 0) printf(" ");
        printf("%d", x->va);
        x = x->next;
    }
    printf("\n");
}
   
   
int main(void) {
    int va, n;
    char order[20];
    scanf("%d", &n);
    note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;
    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &va);
        if(order[0] == 'i') {
            insert(va);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( strlen(order) > 10) {
                    deleteFirst();
                }else if( strlen(order) > 9) {
                    deleteLast();
                }
            }else {
                deleteva(va);
            }
        }
    }
	struct Node *x;
    x = note->next;
    int i = 0;
    while(1) {
        if (x == note) break;
    	if(i++ > 0) printf(" ");
        printf("%d", x->va);
        x = x->next;
    }
    printf("\n");
    return 0;
}

Compiler output:
main.c: In function 'deleteva':
main.c:28:16: error: implicit declaration of function 'search'; did you mean 'bsearch'? [-Wimplicit-function-declaration]
   28 |     deleteNode(search(va));
      |                ^~~~~~
      |                bsearch
main.c:28:16: error: passing argument 1 of 'deleteNode' makes pointer from integer without a cast [-Wint-conversion]
   28 |     deleteNode(search(va));
      |                ^~~~~~~~~~
      |                |
      |                int
main.c:22:30: note: expected 'struct Node *' but argument is of type 'int'
   22 | void deleteNode(struct Node *t) {
      |                 ~~~~~~~~~~~~~^
main.c: At top level:
main.c:38:15: error: conflicting types for 'search'; have 'struct Node *(int)'
   38 |  struct Node* search(int va) {
      |               ^~~~~~
main.c:28:16: note: previous implicit declaration of 'search' with type 'int()'
   28 |     deleteNode(search(va));
      |                ^~~~~~
Language: C

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int va;
    struct Node *prev;
    struct Node *next;
};
   
struct Node *note;
   
void insert(int va) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->va = va;
    note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
   
   
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
}
 void deleteva(int va) {
    deleteNode(search(va));
}  
void deleteFirst() {
    deleteNode(note->next);
}
   
void deleteLast() {
    deleteNode(note->prev);
}

 struct Node* search(int va) {
    struct Node *x = note->next;
    while(x != note && x->va != va ) {
        x = x-> next;
    }
    return x;
}  
void print() {
    struct Node *x;
    x = note->next;
    int i = 0;
    while(1) {
        if (x == note) break;
    	if(i++ > 0) printf(" ");
        printf("%d", x->va);
        x = x->next;
    }
    printf("\n");
}
   
   
int main(void) {
    int k, n;
    char order[20];
    scanf("%d", &n);
    note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;
    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &k);
        if(order[0] == 'i') {
            insert(k);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( strlen(order) > 10) {
                    deleteFirst();
                }else if( strlen(order) > 9) {
                    deleteLast();
                }
            }else {
                deleteva(k);
            }
        }
    }
    print();
    return 0;
}

Compiler output:
main.c: In function 'deleteva':
main.c:28:16: error: implicit declaration of function 'search'; did you mean 'bsearch'? [-Wimplicit-function-declaration]
   28 |     deleteNode(search(va));
      |                ^~~~~~
      |                bsearch
main.c:28:16: error: passing argument 1 of 'deleteNode' makes pointer from integer without a cast [-Wint-conversion]
   28 |     deleteNode(search(va));
      |                ^~~~~~~~~~
      |                |
      |                int
main.c:22:30: note: expected 'struct Node *' but argument is of type 'int'
   22 | void deleteNode(struct Node *t) {
      |                 ~~~~~~~~~~~~~^
main.c: At top level:
main.c:38:15: error: conflicting types for 'search'; have 'struct Node *(int)'
   38 |  struct Node* search(int va) {
      |               ^~~~~~
main.c:28:16: note: previous implicit declaration of 'search' with type 'int()'
   28 |     deleteNode(search(va));
      |                ^~~~~~
Language: C

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
struct Node {
    int va;
    struct Node *prev;
    struct Node *next;
};
   
struct Node *note;
   
void insert(int va) {
    struct Node *x = (struct Node *)malloc(sizeof(struct Node));
    x->va = va;
    note->next->prev = x;
    x->next = note->next;
    note->next = x;
    x->prev = note;
}
   

   
void deleteNode(struct Node *t) {
    if (t == note) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
}
 void deleteva(int va) {
    deleteNode(search(va));
}  
void deleteFirst() {
    deleteNode(note->next);
}
   
void deleteLast() {
    deleteNode(note->prev);
}
   
void print() {
    struct Node *x;
    x = note->next;
    int i = 0;
    while(1) {
        if (x == note) break;
    	if(i++ > 0) printf(" ");
        printf("%d", x->va);
        x = x->next;
    }
    printf("\n");
}
   
   
int main(void) {
    int va, n;
    char order[20];
    scanf("%d", &n);
    note = (struct Node *)malloc(sizeof(struct Node));
    note->next = note;
    note->prev = note;
    for (int i = 0; i < n; i++) {
        scanf("%s%d",order, &va);
        if(order[0] == 'i') {
            insert(va);
        }else if(order[0] == 'd') {
            if(strlen(order) > 6) {
                if( strlen(order) > 10) {
                    deleteFirst();
                }else if( strlen(order) > 9) {
                    deleteLast();
                }
            }else {
                deleteva(va);
            }
        }
    }
    print();
    return 0;
}

Compiler output:
main.c: In function 'deleteva':
main.c:29:16: error: implicit declaration of function 'search'; did you mean 'bsearch'? [-Wimplicit-function-declaration]
   29 |     deleteNode(search(va));
      |                ^~~~~~
      |                bsearch
main.c:29:16: error: passing argument 1 of 'deleteNode' makes pointer from integer without a cast [-Wint-conversion]
   29 |     deleteNode(search(va));
      |                ^~~~~~~~~~
      |                |
      |                int
main.c:23:30: note: expected 'struct Node *' but argument is of type 'int'
   23 | void deleteNode(struct Node *t) {
      |                 ~~~~~~~~~~~~~^
Language: C

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


typedef struct node {long int item; struct node *next; struct node *prev} link;
link *tail;
tail=NULL;
link *insert(link *nxt,long int item){
 link *A;
 A =malloc(sizeof(link));
 A->item = item;
 A-> next =nxt;
 if(nxt==NULL){
 	tail=A;
 }
 nxt-> prev =A;
 return A;
}

link *deleteFirst(link *B){
 link *A;
 A=B->next;
 free(B);
 return A;
}


link *delete(link *B,long int key){
 link *A,*C;
 A=B;
 C=B;
 if(B->item == key){
 B=deleteFirst(B);
 C=B;
}else{
 while(B ->next != NULL && B->item != key){  
 A=B; 
 B = B ->next;
 }
 
 if (B->item==key){
 A->next=A->next->next;
 A->next->prev=A;
 free(B);
}}
 return C;
}


void deleteLast(){
 tail=tail->prev;
 Free(tail->next);
 tail->next=NULL;
}

int main(void){
int n;
long int B;
char A[50];
char *s1 = "insert";
char *s2 = "delete";
char *s3 = "deleteFirst";
char *s4 = "deleteLast";

link *head;
 head =NULL;


scanf("%d",&n);

for (int i=0;i<n;i++){
 scanf("%s",A);

 if(strcmp(s1,A)==0){
 scanf("%ld",&B);
  head=insert(head,B);
 }
 if(strcmp(s2,A)==0){
  scanf("%ld",&B);
  head=delete(head,B);
 }
 if(strcmp(s3,A)==0){
  head=deleteFirst(head);
 }
 if(strcmp(s4,A)==0){
  deleteLast();
 }
}


printf ("%ld",head->item);
link *First;
First = head->next;

while(First !=NULL){
 printf(" %ld",First->item);
 First = First->next;
}
 printf("\n");
return 0;
}

Compiler output:
main.c:6:73: warning: no semicolon at end of struct or union
    6 | typedef struct node {long int item; struct node *next; struct node *prev} link;
      |                                                                         ^
main.c:8:1: warning: data definition has no type or storage class
    8 | tail=NULL;
      | ^~~~
main.c:8:1: error: type defaults to 'int' in declaration of 'tail' [-Wimplicit-int]
main.c:8:1: error: conflicting types for 'tail'; have 'int'
main.c:7:7: note: previous declaration of 'tail' with type 'link *' {aka 'struct node *'}
    7 | link *tail;
      |       ^~~~
main.c: In function 'deleteLast':
main.c:53:2: error: implicit declaration of function 'Free'; did you mean 'free'? [-Wimplicit-function-declaration]
   53 |  Free(tail->next);
      |  ^~~~
      |  free
Language: C

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

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

struct node *nil;

void insertFirst(int);
void insertLast(int);
void delete(struct node*);
struct node* search(int);
void listPrint(void);

int main(){
  int n,i,x;
  char str[15];

  scanf("%d",&n);
  nil = (struct node*)malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;

  for(i = 0; i<n;i++){
    scanf("%s",str);
    if(str[0]== 'i'){
        if(str[6]=='F'){
         scanf("%d",&x);
         insertFirst(x);
        }else if(str[6]=='L'){
            scanf("%d",&x);
            insertLast(x);
        }
    }else if(str[0]=='d'){
      if(str[6]=='\0'){
        scanf("%d",&x);
        delete(search(x));
      }else if(str[6]=='F'){
        delete(nil->next);
      }else{
        delete(nil->prev);
      }
    }
  }
  listPrint();
  return 0;
}




void insertFirst(int key){
  struct node* newnode = (struct node*)malloc(sizeof(struct node));
  newnode->key = key;
  newnode->next = nil->next;
  nil->next->prev = newnode;
  nil->next = newnode;
  newnode->prev = nil;
 }

void delete(struct node* delnode){
  if(delnode == nil){;
  }else{
    delnode->prev->next = delnode->next;
    delnode->next->prev = delnode->prev;
    free(delnode);
  }
}


struct node* search(int key){
  struct node* searchnode = nil->next;
  while(searchnode != nil && searchnode->key != key){
    searchnode = searchnode->next;
  }
return searchnode;
}


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

Compiler output:
/usr/bin/ld: /tmp/cczmUIME.o: in function `main':
main.c:(.text+0xe6): undefined reference to `insertLast'
collect2: error: ld returned 1 exit status