Language: C

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


typedef struct node {long int item; struct node *next;} link;


link *insert(link *nxt,long int item){
 link *A;
 A =malloc(sizeof(link));
 A->item = item;
 A-> next =nxt;
 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;
 free(B);
}}
 return C;
}


link *deleteLast(link *B){
 link *A,*C;
 C = B;
 while(B->next != NULL){
 A=B;
 B = B->next;
 }
 A->next = NULL;
 free(B);
 return C;
}
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){
  head=deleteLast(head);
 }
}


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:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
In file included from main.c:2:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
   98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
      |        ^~~~~~
/usr/include/stdlib.h:57:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
   56 | #include <bits/floatn.h>
  +++ |+#include <stddef.h>
   57 | 
/usr/include/stdlib.h:531:25: error: unknown type name 'size_t'
  531 |                         size_t __statelen) __THROW __nonnull ((2));
      |                         ^~~~~~
/usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:561:25: error: unknown type name 'size_t'
  561 |                         size_t __statelen,
      |                         ^~~~~~
/usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:661:42: error: unknown type name 'size_t'
  661 | extern void arc4random_buf (void *__buf, size_t __size)
      |                                          ^~~~~~
/usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:672:22: error: unknown type name 'size_t'
  672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
      |                      ^~~~~~
/usr/include/stdlib.h:672:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:675:22: error: unknown type name 'size_t'
  675 | extern void *calloc (size_t __nmemb, size_t __size)
      |                      ^~~~~~
/usr/include/stdlib.h:675:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:675:38: error: unknown type name 'size_t'
  675 | extern void *calloc (size_t __nmemb, size_t __size)
      |                                      ^~~~~~
/usr/include/stdlib.h:675:38: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:683:36: error: unknown type name 'size_t'
  683 | extern void *realloc (void *__ptr, size_t __size)
      |                                    ^~~~~~
/usr/include/stdlib.h:683:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:695:41: error: unknown type name 'size_t'
  695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
      |                                         ^~~~~~
/usr/include/stdlib.h:695:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:695:57: error: unknown type name 'size_t'
  695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
      |                                                         ^~~~~~
/usr/include/stdlib.h:695:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:701:41: error: unknown type name 'size_t'
  701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
      |                                         ^~~~~~
/usr/include/stdlib.h:701:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:701:57: error: unknown type name 'size_t'
  701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
      |                                                         ^~~~~~
/usr/include/stdlib.h:701:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/stdlib.h:706:
/usr/include/alloca.h:32:22: error: unknown type name 'size_t'
   32 | extern void *alloca (size_t __size) __THROW;
      |                      ^~~~~~
/usr/include/alloca.h:25:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
   24 | #include <stddef.h>
  +++ |+#include <stddef.h>
   25 | 
/usr/include/stdlib.h:712:22: error: unknown type name 'size_t'
  712 | extern void *valloc (size_t __size) __THROW __attribute_malloc__
      |                      ^~~~~~
/usr/include/stdlib.h:712:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:718:45: error: unknown type name 'size_t'
  718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
      |                                             ^~~~~~
/usr/include/stdlib.h:718:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:718:65: error: unknown type name 'size_t'
  718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
      |                                                                 ^~~~~~
/usr/include/stdlib.h:718:65: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:724:29: error: unknown type name 'size_t'
  724 | extern void *aligned_alloc (size_t __alignment, size_t __size)
      |                             ^~~~~~
/usr/include/stdlib.h:724:29: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:724:49: error: unknown type name 'size_t'
  724 | extern void *aligned_alloc (size_t __alignment, size_t __size)
      |                                                 ^~~~~~
/usr/include/stdlib.h:724:49: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:961:23: error: unknown type name 'size_t'
  961 |                       size_t __nmemb, size_t __size, __compar_fn_t __compar)
      |                       ^~~~~~
/usr/include/stdlib.h:961:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:961:39: error: unknown type name 'size_t'
  961 |                       size_t __nmemb, size_t __size, __compar_fn_t __compar)
      |                                       ^~~~~~
/usr/include/stdlib.h:961:39: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:970:34: error: unknown type name 'size_t'
  970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |                                  ^~~~~~
/usr/include/stdlib.h:970:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:970:50: error: unknown type name 'size_t'
  970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |                                                  ^~~~~~
/usr/include/stdlib.h:970:50: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1044:20: error: unknown type name 'size_t'
 1044 |                    size_t __len) __THROW __nonnull ((3, 4, 5));
      |                    ^~~~~~
/usr/include/stdlib.h:1044:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1047:20: error: unknown type name 'size_t'
 1047 |                    size_t __len) __THROW __nonnull ((3, 4, 5));
      |                    ^~~~~~
/usr/include/stdlib.h:1047:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1051:45: error: unknown type name 'size_t'
 1051 |                     char *__restrict __buf, size_t __len)
      |                                             ^~~~~~
/usr/include/stdlib.h:1051:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1055:45: error: unknown type name 'size_t'
 1055 |                     char *__restrict __buf, size_t __len)
      |                                             ^~~~~~
/usr/include/stdlib.h:1055:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1062:36: error: unknown type name 'size_t'
 1062 | extern int mblen (const char *__s, size_t __n) __THROW;
      |                                    ^~~~~~
/usr/include/stdlib.h:1062:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1066:48: error: unknown type name 'size_t'
 1066 |                    const char *__restrict __s, size_t __n) __THROW;
      |                                                ^~~~~~
/usr/include/stdlib.h:1066:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1073:8: error: unknown type name 'size_t'
 1073 | extern size_t mbstowcs (wchar_t *__restrict  __pwcs,
      |        ^~~~~~
/usr/include/stdlib.h:1073:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1074:53: error: unknown type name 'size_t'
 1074 |                         const char *__restrict __s, size_t __n) __THROW
      |                                                     ^~~~~~
/usr/include/stdlib.h:1074:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1077:8: error: unknown type name 'size_t'
 1077 | extern size_t wcstombs (char *__restrict __s,
      |        ^~~~~~
/usr/include/stdlib.h:1077:8: note: 'size_t' is defined in header '<stddef.h>'; this is probab