Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

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



typedef struct DOUBLYLINKEDLIST{
    struct DOUBLYLINKEDLIST *  prev;
    struct DOUBLYLINKEDLIST *  next;
    int value;
}DOUBLYLINKEDLIST;


void insert(DOUBLYLINKEDLIST **head, DOUBLYLINKEDLIST **tail, int x){
    DOUBLYLINKEDLIST * inserted = (DOUBLYLINKEDLIST *)malloc(sizeof(DOUBLYLINKEDLIST));
    inserted->value = x;
    
    if(*head == NULL && *tail == NULL){
        inserted->prev = NULL;
        inserted->next = NULL;
        *head = inserted;
        *tail = inserted;
    }
    else
    {
        inserted->prev = (*head)->prev;
        (*head)->prev = inserted;
        inserted->next = (*head);
        (*head) = inserted;
    }
    return;
}

void delete(DOUBLYLINKEDLIST **head, DOUBLYLINKEDLIST **tail, int x){
    
    DOUBLYLINKEDLIST * canbedeleted = *head;
    
    if(*head == NULL && *tail == NULL){
        return;
    }
    
    if((*head) == (*tail) && (*head)->value == x){
        free((*head));
        *head = NULL;
        *tail = NULL;
        return;
    }
    
    while(canbedeleted != NULL){
        if(canbedeleted->value == x){

            if(canbedeleted == (*head))
            {
                *head = canbedeleted->next;
                (*head)->prev = NULL;
            }
            else if(canbedeleted == (*tail))
            {
                *tail = canbedeleted->prev;
                (*tail)->next = NULL;
            }
            else
            {
                canbedeleted->prev->next = canbedeleted->next;
                canbedeleted->next->prev = canbedeleted->prev;
            }
            
            free(canbedeleted);
            break;
        }else{
            canbedeleted = canbedeleted->next;
        }
    }
    return;
}

void deleteFirst(DOUBLYLINKEDLIST **head, DOUBLYLINKEDLIST **tail){
    
    DOUBLYLINKEDLIST * deleted = (*head);
    
    if(*head == NULL && *tail == NULL){
        return;
    }
    
    if((*head) == (*tail)){
        *head = NULL;
        *tail = NULL;
        free(deleted);
        return;
    }
    
    (*head) = (*head)->next;
    (*head)->prev = NULL;
    free(deleted);
    
    return;
}

void deleteLast(DOUBLYLINKEDLIST **head, DOUBLYLINKEDLIST **tail){
    
    DOUBLYLINKEDLIST * deleted = (*tail);
    
    if(*head == NULL && *tail == NULL){
        return;
    }
    
    if((*head) == (*tail)){
        *head = NULL;
        *tail = NULL;
        free(deleted);
        return;
    }
    
    (*tail) = (*tail)->prev;
    (*tail)->next = NULL;
    free(deleted);
    return;
}

int main(int argc, const char * argv[]){
    
    //Input
    int i;
    int op_num;
    char operator[20];
    int operand;
    DOUBLYLINKEDLIST * head = NULL;
    DOUBLYLINKEDLIST * tail = NULL;
    
    
    scanf("%d", &op_num);
    
    for(i = 0; i < op_num; i++){
        scanf("%s", operator);
        
        if( !strncmp(operator, "insert", sizeof("insert") ))
        {
            scanf("%d", &operand);
            insert(&head, &tail, operand);
        }
        else if(!strncmp(operator, "delete", sizeof("delete") ))
        {
            scanf("%d", &operand);
            delete(&head, &tail, operand);
        }
        else if(!strncmp(operator, "deleteFirst", sizeof("deleteFirst") ))
        {
            deleteFirst(&head, &tail);
        }
        else if(!strncmp(operator, "deleteLast", sizeof("deleteLast") ))
        {
            deleteLast(&head, &tail);
        }
    }
    
    while(head != NULL){
        printf("%d", head->value);
        if(head->next != NULL){
            printf(" ");
        }
        head = head->next;
    }
    printf("\n");
    
    return 0;
}

Compiler output:
a.cc:41:6: error: expected unqualified-id before 'delete'
   41 | void delete(DOUBLYLINKEDLIST **head, DOUBLYLINKEDLIST **tail, int x){
      |      ^~~~~~
a.cc: In function 'int main(int, const char**)':
a.cc:132:18: error: expected type-specifier before '[' token
  132 |     char operator[20];
      |                  ^
a.cc:141:29: error: expected type-specifier before ')' token
  141 |         scanf("%s", operator);
      |                             ^
a.cc:143:30: error: 'operator,' not defined
  143 |         if( !strncmp(operator, "insert", sizeof("insert") ))
      |                              ^
a.cc:148:34: error: 'operator,' not defined
  148 |         else if(!strncmp(operator, "delete", sizeof("delete") ))
      |                                  ^
a.cc:151:32: error: type 'int' argument given to 'delete', expected pointer
  151 |             delete(&head, &tail, operand);
      |                   ~~~~~~~~~~~~~^~~~~~~~~~
a.cc:153:34: error: 'operator,' not defined
  153 |         else if(!strncmp(operator, "deleteFirst", sizeof("deleteFirst") ))
      |                                  ^
a.cc:157:34: error: 'operator,' not defined
  157 |         else if(!strncmp(operator, "deleteLast", sizeof("deleteLast") ))
      |                                  ^