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

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

typedef struct LIST {
  struct LIST *prev;	// 前
  struct LIST *next;	// 後ろ
  int key;
} LIST;

void insert(int key);	// 追加する
void delete(LIST *p);	// 削除する
void show_list(LIST *p);
void free_list(LIST *p);
LIST *search(int key);

LIST head;	  

int main() {
  int n,i,key;
  double key;
  char c[13];
  LIST *p;

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

    if(strcmp("insert",c)==0){
      scanf("%d",&key);
      insert(key);
    }

    if(strcmp("delete",c)==0){
      scanf("%d",&key);
      delete(search(key));
    }

    if(strcmp("deleteFirst",c)==0){
      delete(head.next);
    }

    if(strcmp("deleteLast",c)==0){
      p=head.next;
      while (p->next != NULL) {     /* 次ポインタがNULLまで処理 */
	p=p->next;
      }
      delete(p);
    }
  }
  show_list(head.next);

  free_list(head.next);	// リストの解放
  return 0;			// 正常終了
}


void insert(int key) {
  LIST *p1;		// 追加
  LIST *p2;		// 挿入前: p -> p2  ⇒　挿入後; p -> p1 -> p2
  LIST *p = &head;	
  /* 記憶領域の確保 */
  if ((p1 = (LIST *) malloc(sizeof(LIST))) == NULL) {
    printf("malloc error\n");
    exit(0);
  }

  p1->key = key;

  // 挿入前: p -> p2  ⇒　挿入後; p -> p1 -> p2
  p2 = p->next;
  p->next = p1;
  p1->next = p2;		
  if (p2 != NULL) p2->prev = p1;
  p1->prev = p;

}

// 削除する
void delete(LIST *p) {	// prev -> p -> next　⇒  prev -> next
  LIST *prev = p->prev;
  LIST *next = p->next;
  free(p);
  prev->next = next;
  if (next != NULL) next->prev = prev;
}

/*** リストの表示 ***/
void show_list(LIST *p) {
  while (p != NULL) {	/* 次ポインタがNULLまで処理 */
    printf("%d", p->key);
    p = p->next;
    if(p!=NULL) printf(" ");
  }
  printf("\n");
}

/*** リストの解放 ***/
void free_list(LIST *p) {
  while (p != NULL) {     /* 次ポインタがNULLまで処理 */
    LIST *p2 = p->next;
    free(p);
    p = p2;
  }
}

LIST *search(int key){
  LIST *p;
  p=head.next;
  while(p!=&head && p->key!=key){
    p = p->next;
  }
  return p;
}

Compiler output:
main.c: In function 'main':
main.c:21:10: error: conflicting types for 'key'; have 'double'
   21 |   double key;
      |          ^~~
main.c:20:11: note: previous declaration of 'key' with type 'int'
   20 |   int n,i,key;
      |           ^~~
Language: C

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

struct node{

  int key;
  struct node *prev;
  struct node *next;

};

typedef struct node Node;

Node *head;

void init()
{
  head = (Node*)malloc(sizeof(Node));
  head -> prev = head;
  head -> next = head;
}
//head -> next?????? ??¢???????????°????????¢????????????
Node *search(int n){
  Node *x = head -> next;
  while( x != head && x -> key != n) x = x -> next;
  return x;
}
 
void insert(int n)//n???head????¬??????????????????????????????????
{
  Node *x;
  x = (Node*)malloc(sizeof(Node));
  x -> key = n;
  x -> next = head -> next;
  head -> next -> prev = x;
  head -> next = x;
  x -> prev = head;
}
 
void delete(int n)//m?????¢????????????????????´??????delete
{
  Node *x = search(n);
  if(x == head) return;
  x -> prev -> next = x -> next;
  x -> next -> prev = x -> prev;
}
 
void deleteFirst(){//?????????delete
  Node *x = head -> next;
  if(x == head) return;
  x -> prev -> next = x -> next;
  x -> next -> prev = x -> prev;
}
 
void deleteLast(){//?????????delete
  Node *x = head -> prev;
  if(x == head) return;
  x -> prev -> next = x -> next;
  x -> next -> prev = x -> prev;
}
 
int main()
{
  int n, i, m;
  Node *node;
  char c[20];
   
  init();
  scanf("%d", &n);

  for( i = 0; i < n; i++) {

    scanf("%s", c);

    if( strcmp(c,"insert") == 0){
      scanf("%d", &m);
      insert(m);
    }
    else if( strcmp(c,"delete") == 0){
      scanf("%d",&m);
      delete(m);
    }
    else if( strcmp(c,"deleteFirst") == 0){
      deleteFirst();
    }
    else if( strcmp(c,"deleteLast") == 0){
      deleteLast();
    }
  }
  for(node = head -> next; node != head;){
    printf("%d", node -> key);
    if((node = node -> next) != head) printf(" ");
  }
  printf("\n");
  return 0;

Compiler output:
main.c: In function 'main':
main.c:96:3: error: expected declaration or statement at end of input
   96 |   return 0;
      |   ^~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:33:26: error: expected '(' before '{' token
   33 |                     while{
      |                          ^
      |                          (
main.c:34:31: error: expected ';' before 'x'
   34 |                       (g!=h++)x[j+h-1]=x[j+h];
      |                               ^
      |                               ;
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:33:26: error: expected '(' before '{' token
   33 |                     while{
      |                          ^
      |                          (
main.c:34:31: error: expected ';' before 'x'
   34 |                       (g!=h++)x[j+h-1]=x[j+1+h-1];
      |                               ^
      |                               ;
Language: C



#include<stdio.h>

 
struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node * NodePointer;
 
NodePointer nil;
 
NodePointer listSearch(int key){
  NodePointer cur = nil->next;
  while( cur != nil && cur->key != key ){
    cur = cur->next;
  }
  return cur;
}
 
void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}
 
void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}
 
void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
  
}
 
void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}
 
void deleteLast(){
  NodePointer t = nil->prev;
  if ( t == nil ) return;
  deleteNode(t);
}
 
void delete(int key){
  NodePointer t = listSearch(key);
  if ( t == nil ) return;
  deleteNode(t);
}
 
 
void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct 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(!( 0 <= key && key <= 2000000000)printf("error");
    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 {
        delete(key); nd++;
      }
      size--;
    }
    if ( size > 1000000 )  printf("error"); 
  }
 
 
  if(!( np+nd <= 2000000))printf("error");
  if(!( nd <= 20))printf("error") ;
  printList();
 
 
  return 0;
}
 

Compiler output:
main.c: In function 'init':
main.c:25:9: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   25 |   nil = malloc(sizeof(struct node));
      |         ^~~~~~
main.c:4:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    3 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    4 | 
main.c:25:9: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   25 |   nil = malloc(sizeof(struct node));
      |         ^~~~~~
main.c:25:9: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c: In function 'insert':
main.c:70:7: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   70 |   x = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:70:7: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c: In function 'main':
main.c:87:41: error: expected ')' before 'printf'
   87 |     if(!( 0 <= key && key <= 2000000000)printf("error");
      |       ~                                 ^~~~~~
      |                                         )
main.c:99:3: error: expected expression before '}' token
   99 |   }
      |   ^
Language: C



#include<stdio.h>

 
struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node * NodePointer;
 
NodePointer nil;
 
NodePointer listSearch(int key){
  NodePointer cur = nil->next;
  while( cur != nil && cur->key != key ){
    cur = cur->next;
  }
  return cur;
}
 
void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}
 
void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}
 
void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
  
}
 
void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}
 
void deleteLast(){
  NodePointer t = nil->prev;
  if ( t == nil ) return;
  deleteNode(t);
}
 
void delete(int key){
  NodePointer t = listSearch(key);
  if ( t == nil ) return;
  deleteNode(t);
}
 
 
void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct 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(!( 0 <= key && key <= 2000000000) printf("error");
    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 {
        delete(key); nd++;
      }
      size--;
    }
    if ( size > 1000000 )  printf("error"); 
  }
 
 
  if(!( np+nd <= 2000000)) printf("error");
  if(!( nd <= 20)) printf("error") ;
  printList();
 
 
  return 0;
}
 

Compiler output:
main.c: In function 'init':
main.c:25:9: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   25 |   nil = malloc(sizeof(struct node));
      |         ^~~~~~
main.c:4:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    3 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    4 | 
main.c:25:9: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   25 |   nil = malloc(sizeof(struct node));
      |         ^~~~~~
main.c:25:9: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c: In function 'insert':
main.c:70:7: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   70 |   x = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:70:7: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c: In function 'main':
main.c:87:41: error: expected ')' before 'printf'
   87 |     if(!( 0 <= key && key <= 2000000000) printf("error");
      |       ~                                 ^~~~~~~
      |                                         )
main.c:99:3: error: expected expression before '}' token
   99 |   }
      |   ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#define LEN 100005

void initialize(void);
int isEmpty(void);
int isFull(void);
void enqueue(int);
void dequeue(void);

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

int Q[LEN+1];
int head, tail, n;

int main()
{
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  initialize();

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'd' ){
      if( com[6] == 'F') deleteFirst();
      else if( com[6] == 'L') deleteLast();
      else {
	scanf("%d", &x);
	delete(x);
      }
    }
  }

  for(i = tail;i >= head; i--){
    if(Q[i] != 0) printf("%d",Q[i]);
    if(Q[i-1] != head - 1) printf(" ")
  }
  printf("\n");

  return 0;
}

void insert(int x) {
  enqueue(x);
}

void deleteFirst(void){
  Q[head] = 0;
  head++;
}

void deleteLast(void){
  Q[tail - 2] = 0;
  tail--;
}

void delete(int x){
  int i,j,c = 0;

  for(i = 0;(head + i) < tail;i++){
    if(Q[head+i] == x){
      for(j = 0;(head + i + j) <= tail;j++){
	Q[head + i + j] = Q[head + i + j + 1];
	c++;
      }
      tail - c;
      printf("\n");
    }
  }

}

void enqueue(int x){
  if(isFull() == 1){
    fprintf(stderr,"オーバーフロー\n");
    exit(1);
  }

  Q[tail] = x;

  if((tail + 1) == (LEN+1)) tail = 0;
  else tail++;
}

void dequeue(void){
  int x;
  if(isEmpty() == 1){
    fprintf(stderr,"アンダーフロー\n");
    exit(1);
  }
   
  x = Q[head];

  if((head + 1) == (LEN+1)) head = 0;

  else head++;

}

int isEmpty(void)
{
  if(head == tail) return 1;
  return 0;
}

int isFull(void)
{
  if(head == (tail + 1) % (LEN+1)) return 1;
  return 0;
}

void initialize(void)
{
  head  = 0;
  tail  = 0;
}

Compiler output:
main.c: In function 'main':
main.c:44:39: error: expected ';' before '}' token
   44 |     if(Q[i-1] != head - 1) printf(" ")
      |                                       ^
      |                                       ;
   45 |   }
      |   ~
Language: C

#define MAX 1000000

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

//?§???????.
typedef struct command {
	char txt[12];
	int x = 0;
}com;

//????????????????????£?¨?.
void ins(int x);
void del(int x);
void delF(void);
void delL(void);

//??°?????????????????°.
int head = 0;
int tail = 0;
int num[MAX] = {};


int main(void) {
	int n = 0;		//????????°.
	com buf;		//????????????.
	int i = 0;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%s", buf.txt);		//?????????????????????.
		
		if (strcmp(buf.txt, "insert") == 0) {
			scanf("%d", &buf.x);
			ins(buf.x);
			printf("%s\n", buf.txt);//???????????°.
			printf("head%d tail%d\n", head, tail);//debug.
		}
		else if (strcmp(buf.txt, "delete") == 0) {
			scanf("%d", &buf.x);
			del(buf.x);
			printf("%s\n", buf.txt);//???????????°.
			printf("head%d tail%d\n", head, tail);//debug.
		}
		else if (strcmp(buf.txt, "deleteFirst") == 0) {
			delF();
			printf("%s\n", buf.txt);//???????????°.
		}
		else if (strcmp(buf.txt, "deleteLast") == 0) {
			delL();
			printf("%s\n", buf.txt);//???????????°.
		}
	}

	for (i = head - 1; i >= tail; i--) {
		if (i != tail)
			printf("%d ", num[i]);
		else
			printf("%d\n", num[i]);
	}

	printf("head%d tail%d\n", head, tail);//debug.

	return 0;
}

void ins(int x) {
	num[head] = x;
	head++;
}

void del(int x) {
	int i = 0;
	int v[2] = {};
	v[1] = num[head - 1];

	head--;

	for (i = head - 1; i >= tail; i--) {
		v[0] = num[i];
		num[i] = v[1];

		if (v[0] == x)
			break;
		else {
			v[1] = v[0];
		}
	}
}

void delF(void) {
	num[head - 1] = 0;
	head--;
}

void delL(void) {
	num[tail] = 0;
	tail++;
}

Compiler output:
main.c:9:15: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
    9 |         int x = 0;
      |               ^
main.c: In function 'main':
main.c:35:41: error: 'com' {aka 'struct command'} has no member named 'x'
   35 |                         scanf("%d", &buf.x);
      |                                         ^
main.c:36:32: error: 'com' {aka 'struct command'} has no member named 'x'
   36 |                         ins(buf.x);
      |                                ^
main.c:41:41: error: 'com' {aka 'struct command'} has no member named 'x'
   41 |                         scanf("%d", &buf.x);
      |                                         ^
main.c:42:32: error: 'com' {aka 'struct command'} has no member named 'x'
   42 |                         del(buf.x);
      |                                ^
Language: C

#define MAX 1000000

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

//?§???????.
typedef struct command {
	char txt[12];
	int x = 0;
}com;

//????????????????????£?¨?.
void ins(int x);
void del(int x);
void delF(void);
void delL(void);

//??°?????????????????°.
int head = 0;
int tail = 0;
int num[MAX];


int main(void) {
	int n = 0;		//????????°.
	com buf;		//????????????.
	int i = 0;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%s", buf.txt);		//?????????????????????.
		
		if (strcmp(buf.txt, "insert") == 0) {
			scanf("%d", &buf.x);
			ins(buf.x);
			printf("%s\n", buf.txt);//???????????°.
			printf("head%d tail%d\n", head, tail);//debug.
		}
		else if (strcmp(buf.txt, "delete") == 0) {
			scanf("%d", &buf.x);
			del(buf.x);
			printf("%s\n", buf.txt);//???????????°.
			printf("head%d tail%d\n", head, tail);//debug.
		}
		else if (strcmp(buf.txt, "deleteFirst") == 0) {
			delF();
			printf("%s\n", buf.txt);//???????????°.
		}
		else if (strcmp(buf.txt, "deleteLast") == 0) {
			delL();
			printf("%s\n", buf.txt);//???????????°.
		}
	}

	for (i = head - 1; i >= tail; i--) {
		if (i != tail)
			printf("%d ", num[i]);
		else
			printf("%d\n", num[i]);
	}

	printf("head%d tail%d\n", head, tail);//debug.

	return 0;
}

void ins(int x) {
	num[head] = x;
	head++;
}

void del(int x) {
	int i = 0;
	int v[2] = {};
	v[1] = num[head - 1];

	head--;

	for (i = head - 1; i >= tail; i--) {
		v[0] = num[i];
		num[i] = v[1];

		if (v[0] == x)
			break;
		else {
			v[1] = v[0];
		}
	}
}

void delF(void) {
	num[head - 1] = 0;
	head--;
}

void delL(void) {
	num[tail] = 0;
	tail++;
}

Compiler output:
main.c:9:15: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
    9 |         int x = 0;
      |               ^
main.c: In function 'main':
main.c:35:41: error: 'com' {aka 'struct command'} has no member named 'x'
   35 |                         scanf("%d", &buf.x);
      |                                         ^
main.c:36:32: error: 'com' {aka 'struct command'} has no member named 'x'
   36 |                         ins(buf.x);
      |                                ^
main.c:41:41: error: 'com' {aka 'struct command'} has no member named 'x'
   41 |                         scanf("%d", &buf.x);
      |                                         ^
main.c:42:32: error: 'com' {aka 'struct command'} has no member named 'x'
   42 |                         del(buf.x);
      |                                ^
Language: C

import collections from deque
dq = deque()
num = int(input())

for i in range(num):
    order = imput().split()

    if com[0] == 'insert':
        dq.appendleft(com[1])
    elif com[0] == 'deleteFirst':
        dq.popleft()
    elif com[0] == 'deleteLast':
        dq.pop()
    else:
        if com[1] in dq:
            dq.remove(com[1])

print(' '.join(dq))

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import collections from deque
      | ^~~~~~
main.c:1:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'from'
    1 | import collections from deque
      |                    ^~~~
main.c:1:20: error: unknown type name 'from'
main.c:8:18: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
    8 |     if com[0] == 'insert':
      |                  ^~~~~~~~
main.c:10:20: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   10 |     elif com[0] == 'deleteFirst':
      |                    ^~~~~~~~~~~~~
main.c:12:20: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   12 |     elif com[0] == 'deleteLast':
      |                    ^~~~~~~~~~~~
Language: C

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

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

node *head;

node *makenode(int);
void insert(int);
void delete(int);
void deleteFirst();
void deleteLast();

int main()
{
    int i, n, a;
    char op[16];
    node *x;
    
    head = makenode(0);
    head->next = head;
    head->prev = head;
    
    scanf("%d", &n);
    for(i=0; i<n; i++)
    {
        scanf("%s", op);
        if(strcmp(op, "insert") == 0)
        {
            scanf("%d", &a);
            insert(a);
        }
        else if(strcmp(op, "delete") == 0)
        {
            scanf("%d", &a);
            delete(a);
        }
        else if(strcmp(op, "deleteFirst") == 0)
        {
            deleteFirst();
        }
        else if(strcmp(op, "deleteLast") == 0)
        {
            deleteLast();
        }
    }
    
    x = head;
    while(x->next != head)
    {
        printf("%d", x->next->key);
        x = x->next;
        if(x->next != head)
        {
            printf(" ");
        }
    }
    printf("\n");

    return 0;
}



node *makenode(int a)
{
    node *x;
    x = malloc(sizeof(_node));
    x->key = a;
    return x;
}
void insert(int a)
{
    node *x;
    x = makenode(a);
    x->next = head->next;
    head->next->prev = x;
    head->next = x;
    x->prev = head;
}
void delete(int a)
{
    node *x;
    x = head;
    
    while(x->next != head)
    {
        x = x->next;
        if(x->key == a)
        {
            x->prev->next = x->next;
            x->next->prev = x->prev;
            free(x);
            break;
        }
    }
}
void deleteFirst()
{
    node *x;
    x = head->next;
    head->next = x->next;
    x->next->prev = head;
    free(x);
}
void deleteLast()
{
    node *x;
    x = head->prev;
    head->prev = x->prev;
    x->prev->next = head;
    free(x);
}

Compiler output:
main.c: In function 'makenode':
main.c:74:23: error: '_node' undeclared (first use in this function)
   74 |     x = malloc(sizeof(_node));
      |                       ^~~~~
main.c:74:23: 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 *next;
};
typedef struct node *NodePointer;

NodePointer insert(int);
NodePointer delete(int);
NodePointer deleteFirst(void);
NodePointer deleteLast(void);
NodePointer finditem(int);
void        listPrint(void);
NodePointer make_1node(int, NodePointer);
NodePointer head;


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

  head = make_1node(0, NULL);
  scanf("%d", &n);
  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(x);
      }
      else if(str[6] == 'F') {
        deleteFirst();
      }
      else {}
      (strcmp("deleteLast", str) == 0)
      deleteLast();
    }
  }

  listPrint();
  return 0;
}


NodePointer insert(int keydata) {
  NodePointer newnode;

  newnode = make_1node(keydata, head->next);
  head->next = newnode;
  return newnode;
}

NodePointer delete(int keydata) {
  NodePointer n, delnode;

  if((n = finditem(keydata)) != NULL) {
    delnode = n->next;
    n->next = delnode->next;
    free(delnode);
    return n;
  }
  else return NULL;
}

NodePointer deleteFirst(void) {
  NodePointer delnode;

  delnode = head->next;
  head->next = delnode->next;
  free(delnode);
  return head;
}


NodePointer deleteLast(void) {
  NodePointer n, delnode;

  for(n = head; n->next->next != NULL; n = n->next) {}
  delnode = n->next;
  n->next = NULL;
  free(delnode);
  return n;
}

NodePointer finditem(int keydata) {
  NodePointer n;

  for(n = head; n->next != NULL; n = n->next) {
    if(n->next->key == keydata) return n;
  }
  return NULL;
}

void listPrint(void) {
  NodePointer n;

  for(n = head->next; n != NULL; n = n->next) {
    if(n != head->next) printf(" ");
    printf("%d", n->key);
  }
  printf("\n");
}

NodePointer make_1node(int keydata, NodePointer p) {
  NodePointer n;

  if((n = (NodePointer)malloc(sizeof(struct node))) == NULL) {
    exit(8);
  }
  n->key = keydata;
  n->next = p;
  return n;
}

Compiler output:
main.c: In function 'main':
main.c:41:8: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   41 |       (strcmp("deleteLast", str) == 0)
      |        ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:41:39: error: expected ';' before 'deleteLast'
   41 |       (strcmp("deleteLast", str) == 0)
      |                                       ^
      |                                       ;
   42 |       deleteLast();
      |       ~~~~~~~~~~
Language: C

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

struct node {
  int key;
  struct node *next;
};
typedef struct node *NodePointer;

NodePointer insert(int);
NodePointer delete(int);
NodePointer deleteFirst(void);
NodePointer deleteLast(void);
NodePointer finditem(int);
void        listPrint(void);
NodePointer make_1node(int, NodePointer);
NodePointer head;


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

  head = make_1node(0, NULL);
  scanf("%d", &n);
  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(x);
      }
      else if(str[6] == 'F') {
        deleteFirst();
      }
      else {
      (strcmp("deleteLast", str) == 0)
      deleteLast();
    }
  }

  listPrint();
  return 0;
}


NodePointer insert(int keydata) {
  NodePointer newnode;

  newnode = make_1node(keydata, head->next);
  head->next = newnode;
  return newnode;
}

NodePointer delete(int keydata) {
  NodePointer n, delnode;

  if((n = finditem(keydata)) != NULL) {
    delnode = n->next;
    n->next = delnode->next;
    free(delnode);
    return n;
  }
  else return NULL;
}

NodePointer deleteFirst(void) {
  NodePointer delnode;

  delnode = head->next;
  head->next = delnode->next;
  free(delnode);
  return head;
}


NodePointer deleteLast(void) {
  NodePointer n, delnode;

  for(n = head; n->next->next != NULL; n = n->next) {}
  delnode = n->next;
  n->next = NULL;
  free(delnode);
  return n;
}

NodePointer finditem(int keydata) {
  NodePointer n;

  for(n = head; n->next != NULL; n = n->next) {
    if(n->next->key == keydata) return n;
  }
  return NULL;
}

void listPrint(void) {
  NodePointer n;

  for(n = head->next; n != NULL; n = n->next) {
    if(n != head->next) printf(" ");
    printf("%d", n->key);
  }
  printf("\n");
}

NodePointer make_1node(int keydata, NodePointer p) {
  NodePointer n;

  if((n = (NodePointer)malloc(sizeof(struct node))) == NULL) {
    exit(8);
  }
  n->key = keydata;
  n->next = p;
  return n;
}

Compiler output:
main.c: In function 'main':
main.c:41:8: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   41 |       (strcmp("deleteLast", str) == 0)
      |        ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:41:39: error: expected ';' before 'deleteLast'
   41 |       (strcmp("deleteLast", str) == 0)
      |                                       ^
      |                                       ;
   42 |       deleteLast();
      |       ~~~~~~~~~~                       
main.c:119:1: error: expected declaration or statement at end of input
  119 | }
      | ^
Language: C

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

#define N 10000

int main(){
  int i,j,n,num,list[N],head=0,tmp,tail=0;
  char sel[N][11];
  char *s1="insert";
  char *s2="delete";
  char *s3="deleteFirst";
  char *s4="deleteLast";
  
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",sel[i]);
    if(strcmp(sel[i],s1)==0){
      tail++;
      for(j=0;j<tail;j++) list[j+1]=list[j];
      scanf("%d",&list[head]);
    }
    
    else if(strcmp(sel[i],s2)==0){
      scanf("%d",&num);
      for(j=0;j<tail;j++){
	if(list[j]==num){
	  list[j]=list[j+1];
	}
      }
      tail--;
    }

    else if(strcmp(sel[i],s3)==0) {
      head++;
    }
    
    else if(strcmp(sel[i],s4)==0){
      tail--;
    }
    
  }

  for(i=head;i<tail-1;i++) printf("%d ",list[i]);
  printf("%d\n",list[tail-1]);
  
  return 0;

Compiler output:
main.c: In function 'main':
main.c:47:3: error: expected declaration or statement at end of input
   47 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
typedef struct node{
  int key;
  struct node* next;
  struct node* prev;
}Node;
 
Node *NIL;
void init(void);
void printList(void);
Node* listSearch(int);
void insert(int);
void deleteNode(Node *);
void deleteLast(void);
void deleteKey(int);

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

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");
}
 
Node* listSearch(int key){
  Node *cur = nil -> next;
  while(cur != NIL && cur -> key != key) cur = cur -> next;
  return cur;
}
 
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 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));
}
 

Compiler output:
main.c: In function 'main':
main.c:35:23: error: implicit declaration of function 'deleteFirst'; did you mean 'deleteLast'? [-Wimplicit-function-declaration]
   35 |     if(com[6] == 'F') deleteFirst();
      |                       ^~~~~~~~~~~
      |                       deleteLast
main.c: In function 'listSearch':
main.c:69:15: error: 'nil' undeclared (first use in this function)
   69 |   Node *cur = nil -> next;
      |               ^~~
main.c:69:15: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:77:15: error: 'nil' undeclared (first use in this function)
   77 |   x -> next = nil -> next;
      |               ^~~
main.c: At top level:
main.c:90:6: warning: conflicting types for 'deleteFirst'; have 'void()'
   90 | void deleteFirst(){
      |      ^~~~~~~~~~~
main.c:35:23: note: previous implicit declaration of 'deleteFirst' with type 'void()'
   35 |     if(com[6] == 'F') deleteFirst();
      |                       ^~~~~~~~~~~
Language: C

#include<stdio.h>

int main(){
  char c[10];
  int n,i,j,k,h[100000],min=0,max=0,num;
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%s",c);
    
    if(c[0] == 'i'){
      scanf("%d",&h[max]);
      max++;
    }
    else if(c[0]=='d'){
      
      if(c[6]=='F'){
	  min++;
      }

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

      else {
	scanf("%d",&num);
	max--;
	for(j=min;j<=max;j++){
	  if(h[j]==num){
	    for(k=j;k<=max;k++) h[k]=h[k+1];
	  }
	}
      }
    }
  }
for(i=min;i<max;i++) {
    if(i!=max-1){
      printf("%d ",h[i]);
    }
    else if(i==max-1){
      printf("%d\n",h[i]);
    }
   return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:45:1: error: expected declaration or statement at end of input
   45 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
	char name[100];
	int t;
}P;

P Q[LEN]
int head,tail,n;

void enqueue(P x){
	Q[tail] = x;
	tail = (tail+1)%LEN;
}
P dequeue(void){
	P x = Q[LEN];
	head = (head+1)%LEN;
	return x;
}

int min(int a,int b){
	return a < b ? a : b;
}
int main(void){
	int elaps = 0,c;
	int i,q;
	P u;
	scanf("%d %d",&n,&Q);
	for(i=1;i<=n;i++){
		scanf("%s",Q[i].name);
		scanf("%d",&Q[i].t);
	}
	
	head = 1;
	tail =n+1;
	
	while(head!=tail){
		u = dequeue();
		c = min(q,u,t);
		u.t -= c;
		if(u.t > 0)
		enqueue(u);
	} else {
		printf("%s %d\n",u.name, elaps);
	}
}
return 0;
}

Compiler output:
main.c:10:9: error: expected ';' before 'int'
   10 | P Q[LEN]
      |         ^
      |         ;
   11 | int head,tail,n;
      | ~~~      
main.c: In function 'enqueue':
main.c:14:9: error: 'Q' undeclared (first use in this function)
   14 |         Q[tail] = x;
      |         ^
main.c:14:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:18:15: error: 'Q' undeclared (first use in this function)
   18 |         P x = Q[LEN];
      |               ^
main.c: In function 'main':
main.c:30:27: error: 'Q' undeclared (first use in this function)
   30 |         scanf("%d %d",&n,&Q);
      |                           ^
main.c:41:29: error: 't' undeclared (first use in this function)
   41 |                 c = min(q,u,t);
      |                             ^
main.c:41:27: error: incompatible type for argument 2 of 'min'
   41 |                 c = min(q,u,t);
      |                           ^
      |                           |
      |                           P {aka struct pp}
main.c:23:19: note: expected 'int' but argument is of type 'P' {aka 'struct pp'}
   23 | int min(int a,int b){
      |               ~~~~^
main.c:41:21: error: too many arguments to function 'min'
   41 |                 c = min(q,u,t);
      |                     ^~~
main.c:23:5: note: declared here
   23 | int min(int a,int b){
      |     ^~~
main.c:45:11: error: 'else' without a previous 'if'
   45 |         } else {
      |           ^~~~
main.c: At top level:
main.c:49:1: error: expected identifier or '(' before 'return'
   49 | return 0;
      | ^~~~~~
main.c:50:1: error: expected identifier or '(' before '}' token
   50 | }
      | ^
Language: C

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

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

Node *nil;

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

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

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



void 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 delteFirst(void) {
  deleteNode(nil->next);
}

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

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') {}
  }
}

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

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


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

Node *nil;

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

void init(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:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

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

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

Node *nil;

struct Node* listSearch(int key){
  Node *cur = nil->next;
  while(cur != nil && cur ->key !=key){
    cur =cur->next;
  }
  return cur;
}
void init(){
  nil = (Node *)malloc(sizeof(Node));
  nil->next=nil;
  nil->prev=nil;
}
void printList(){
  Node *cur =nil->next;
  int isf=0;
  while(1){
    if(cur==nil)break;
    if(isf++>0)printf(" ");
    printf("%d",???cur->key);
    cur=cur->next;
  }
  printf("\n");
}

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

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

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

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

int main(){
  int key,n,i;
  int size=0;
  char com[20];
  int np=0,nd=0;
  scanf("%d",&n);
  init();
  for(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:
main.c: In function 'printList':
main.c:30:17: error: expected expression before '?' token
   30 |     printf("%d",???cur->key);
      |                 ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
  
struct node{
  int key;
  struct node *next;
  struct node *prev;
};
  
typedef struct node * NodePointer;

void insert(int keydata){
    NodePointer x;
    x=malloc(sizeof(struct node));
    x->key=keydata;
    x->next=nil->next;
    x->prev=nil;
    nil->next=x;
    x->next->prev=x;
}

int delete(int keydata){
  NodePointer p;
  p=nil->next;
  while(p!=nil&&p->key!=keydata){
    p=p->next;
  }
  if(p==nil){
    return 0;
  }else{
    p->prev->next=p->next;
    p->next->prev=p->prev;
    free(p);
    return 0;
  }
}

int deleteFirst(){
    NodePointer p;
    p=nil->next;
    nil->next=p->next;
    p->next->prev=nil;
    free(p);
    return 0;
}
int deleteLast(){
    NodePointer p;
    p=nil->prev;
    p->prev->next=nil;
    nil->prev=p->prev;
    free(p);
    return 0;
}

void init(){
  nil->next=nil;
  nil->prev=nil;
}

main(){
  int n, i, keydata;
  char com[12];
  NodePointer p;
  scanf("%d",&n);
  nil=malloc(sizeof(struct node));
  init();
   
  for (i=0;i<n;i++){
    scanf("%s",com);
    if(strlen(com)>6){
      if(com[6]=='F') {
    deleteFirst();
      }else{
    deleteLast();
      }
    }else{
      scanf("%d",&keydata);
      if(com[0]=='i'){
    insert(keydata);
      }else{
    delete(keydata);
      }
    }
  }
 
  for(p=nil->next;p!=nil->prev;p=p->next){
    printf("%d ",p->key);
  }
  printf("%d\n",p->key);
  free(nil);
  return 0;
}

Compiler output:
main.c: In function 'insert':
main.c:17:13: error: 'nil' undeclared (first use in this function)
   17 |     x->next=nil->next;
      |             ^~~
main.c:17:13: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'delete':
main.c:25:5: error: 'nil' undeclared (first use in this function)
   25 |   p=nil->next;
      |     ^~~
main.c: In function 'deleteFirst':
main.c:41:7: error: 'nil' undeclared (first use in this function)
   41 |     p=nil->next;
      |       ^~~
main.c: In function 'deleteLast':
main.c:49:7: error: 'nil' undeclared (first use in this function)
   49 |     p=nil->prev;
      |       ^~~
main.c: In function 'init':
main.c:57:3: error: 'nil' undeclared (first use in this function)
   57 |   nil->next=nil;
      |   ^~~
main.c: At top level:
main.c:61:1: error: return type defaults to 'int' [-Wimplicit-int]
   61 | main(){
      | ^~~~
main.c: In function 'main':
main.c:66:3: error: 'nil' undeclared (first use in this function)
   66 |   nil=malloc(sizeof(struct node));
      |   ^~~
Language: C

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

#define MAX 2000000000
#define MAX2 1000000
#define MAX3 2000000

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

typedef struct node * NodePointer;

NodePointer nil;
NodePointer listSearch(int);
void init();
void printList();
void deleteNode(NodePointer );
void deleteFirst();
void deleteLast();
void delete(int);
void insert(int);

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(!( 0 <= key && key <= MAX)){
      printf("error\n") ;
    }
    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 {
	delete(key); nd++; 
      }
      size--;
    }
    if ( size > MAX2 ) {
      printf("error\n");
    }
  }

  if(!( np+nd <= MAX3)){
    printf("error\n");
  }
  if(!( nd <= 20)){
    printf("error\n");
  }
  
  printList();
  return 0;
}

NodePointer listSearch(int key){
  NodePointer c = nil->next;
  while( c != nil && c->key != key ){
    c = c->next;
  }
  return c;  
}

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

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

void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t); 
}

void deleteLast(){
  NodePointer t = nil->prev;
  if ( t == nil ) return;
  deleteNode(t); 
}

void delete(int key){
  NodePointer t = listSearch(key)
  if ( t == nil ) return;
  deleteNode(t);
}


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

Compiler output:
main.c: In function 'delete':
main.c:122:3: error: expected ',' or ';' before 'if'
  122 |   if ( t == nil ) return;
      |   ^~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:26:14: error: subscripted value is neither array nor pointer nor vector
   26 |     else if(a[6]=='L')
      |              ^
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
  
typedef struct Node* NodePointer;
  
typedef struct Node {
  int k;
  NodePointer next, p;
} Node;
  
NodePointer head, last;
  
NodePointer make_node(int k) {
  NodePointer tmp = malloc(sizeof(Node));
  tmp->next = tmp->p = NULL;
  tmp->k = k;
  return tmp;
}
  
void init() {
  head = malloc(sizeof(Node));
  last = malloc(sizeof(Node));
  head->next = last;
  last->pre = head;
}
  
void insert(NodePointer s, int k) {
  NodePointer node = make_node(k);
  NodePointer t = s->next;
  s->next = node;
  node->p = s;
  node->next = t;
  t->p = node;
}
  
void delete(NodePointer p) {
  NodePointer s = p->p;
  NodePointer t = p->next;
  s->next = t;
  t->p = s;
  free(p);
}
  
int main() {
  int N, num;
  char str[30];
  NodePointer p;
  init();
  scanf(" %d ", &N);
  while(N--) {
    scanf(" %s ", str);
    if(!strcmp(str,"insert")) {
      scanf(" %d ", &num);
      insert(head,num);
    } else if(!strcmp(str,"delete")) {
      scanf(" %d ", &num);
      for(p = head->next; p != last; p = p->next) {
        if(p->k == num) {
          delete(p);
          break;
        }
      }
    } else if(!strcmp(str,"deleteFirst")) {
      delete(head->next);
    } else if(!strcmp(str,"deleteLast")) {
      delete(last->p);
    }
  }
  
  for(p = head->next; p != last; p = p->next) {
    printf(p == head->next? "%d":" %d", p->k);
  }
  printf("\n");
  
  return 0;
}

Compiler output:
main.c: In function 'init':
main.c:25:7: error: 'struct Node' has no member named 'pre'
   25 |   last->pre = head;
      |       ^~