Language: C

    if(isf++>0)printf(" ");
    printf("%d",cur->key);
    cur=cur->next;
  }
  printf("\n");
}
void delete(struct Node *t){
  if(t==nil)return;
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
}
void deletefirst(){
  delete(nil->next);
}void deletelast(){
  delete(nil->prev);
}
void deletekey(int key){
  delete(listSearch(key));
}
void insert(int key){
struct  Node *x=(struct Node *)malloc(sizeof(struct Node));
 x->key=key;
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
  x->prev=nil;
}
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--;
    }
  }
  print();
  return 0;
}
 

Compiler output:
main.c:1:5: error: expected identifier or '(' before 'if'
    1 |     if(isf++>0)printf(" ");
      |     ^~
main.c:2:12: error: expected declaration specifiers or '...' before string constant
    2 |     printf("%d",cur->key);
      |            ^~~~
main.c:2:17: error: unknown type name 'cur'
    2 |     printf("%d",cur->key);
      |                 ^~~
main.c:3:5: warning: data definition has no type or storage class
    3 |     cur=cur->next;
      |     ^~~
main.c:3:5: error: type defaults to 'int' in declaration of 'cur' [-Wimplicit-int]
main.c:3:12: error: invalid type argument of '->' (have 'int')
    3 |     cur=cur->next;
      |            ^~
main.c:4:3: error: expected identifier or '(' before '}' token
    4 |   }
      |   ^
main.c:5:10: error: expected declaration specifiers or '...' before string constant
    5 |   printf("\n");
      |          ^~~~
main.c:6:1: error: expected identifier or '(' before '}' token
    6 | }
      | ^
main.c:7:20: warning: 'struct Node' declared inside parameter list will not be visible outside of this definition or declaration
    7 | void delete(struct Node *t){
      |                    ^~~~
main.c: In function 'delete':
main.c:8:9: error: 'nil' undeclared (first use in this function)
    8 |   if(t==nil)return;
      |         ^~~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:4: error: invalid use of undefined type 'struct Node'
    9 |   t->prev->next=t->next;
      |    ^~
main.c:9:18: error: invalid use of undefined type 'struct Node'
    9 |   t->prev->next=t->next;
      |                  ^~
main.c:10:4: error: invalid use of undefined type 'struct Node'
   10 |   t->next->prev=t->prev;
      |    ^~
main.c:10:18: error: invalid use of undefined type 'struct Node'
   10 |   t->next->prev=t->prev;
      |                  ^~
main.c:11:3: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   11 |   free(t);
      |   ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'free'
  +++ |+#include <stdlib.h>
    1 |     if(isf++>0)printf(" ");
main.c:11:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   11 |   free(t);
      |   ^~~~
main.c:11:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c: In function 'deletefirst':
main.c:14:10: error: 'nil' undeclared (first use in this function)
   14 |   delete(nil->next);
      |          ^~~
main.c: In function 'deletelast':
main.c:16:10: error: 'nil' undeclared (first use in this function)
   16 |   delete(nil->prev);
      |          ^~~
main.c: In function 'deletekey':
main.c:19:10: error: implicit declaration of function 'listSearch' [-Wimplicit-function-declaration]
   19 |   delete(listSearch(key));
      |          ^~~~~~~~~~
main.c:19:10: error: passing argument 1 of 'delete' makes pointer from integer without a cast [-Wint-conversion]
   19 |   delete(listSearch(key));
      |          ^~~~~~~~~~~~~~~
      |          |
      |          int
main.c:7:26: note: expected 'struct Node *' but argument is of type 'int'
    7 | void delete(struct Node *t){
      |             ~~~~~~~~~~~~~^
main.c: In function 'insert':
main.c:22:32: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   22 | struct  Node *x=(struct Node *)malloc(sizeof(struct Node));
      |                                ^~~~~~
main.c:22:32: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:22:32: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
main.c:22:32: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:22:46: error: invalid application of 'sizeof' to incomplete type 'struct Node'
   22 | struct  Node *x=(struct Node *)malloc(sizeof(struct Node));
      |                                              ^~~~~~
main.c:23:3: error: invalid use of undefined type 'struct Node'
   23 |  x->key=key;
      |   ^~
main.c:24:4: error: invalid use of undefined type 'struct Node'
   24 |   x->next=nil->next;
      |    ^~
main.c:24:11: error: 'nil' undeclared (first use in this function)
   24 |   x->next=nil->next;
      |           ^~~
main.c:27:4: error: invalid use of undefined type 'struct Node'
   27 |   x->prev=nil;
      |    ^~
main.c: In function 'main':
main.c:34:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   34 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 |     if(isf++>0)printf(" ");
main.c:34:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   34 |   scanf("%d",&n);
      |   ^~~~~
main.c:34:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:35:3: error: implicit declaration of function 'init' [-Wimplicit-function-declaration]
   35 |   init();
      |   ^~~~
main.c:44:10: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   44 |       if(strlen(com)>6){
      |          ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 |     if(isf++>0)printf(" ");
main.c:44:10: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   44 |       if(strlen(com)>6){
      |          ^~~~~~
main.c:44:10: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:54:3: error: implicit declaration of function 'print' [-Wimplicit-function-declaration]
   54 |   print();
      |   ^~~~~