Language: C

/* C++ */
// ??£???????????? P97

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

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

node NIL_TOP;
node NIL_END;
// ?????????????????¨???????????????????????¨??£??? 
void initNIL(void){
	NIL_TOP.key = 0;
	NIL_TOP.next = &NIL_TOP;
	NIL_TOP.prev = &NIL_END;
	NIL_END.key = 0;
	NIL_END.next = &NIL_TOP;
	NIL_END.prev = &NIL_END;	
}

// ?????????node????????\
void insertkey(int key){
	node* x = (node*)malloc(sizeof(node));
	x->key = key;
	x->next = &NIL_TOP;
	x->prev =  NIL_TOP.prev;
	NIL_TOP.prev->next = x;
	NIL_TOP.prev = x;

}

// ????????????key??????????????????????´??????????
void deletekey(int searchkey){
	node* x = NIL_TOP.prev;
	while(x->prev != x){
		if(x->key == searchkey){
			// KEY??????????????£???
			x->next->prev = x->prev;
			x->prev->next = x->next;
			delete x;
			break;
		}else{
			x = x->prev;
		}
	}
}

// ???????????????
void deleteFirst(void){
	node* x = NIL_TOP.prev;
	x->next->prev = x->prev;
	x->prev->next = x->next;
	delete x;
}

// ????°??????????
void deleteLast(void){
	node* x = NIL_END.next;
	x->next->prev = x->prev;
	x->prev->next = x->next;
	delete x;
}

int main(int argc, char const *argv[])
{
	int inputNum;
	int loop;
	int key;
	char command[10];
	node* x;

	//????????°?????????
	scanf("%d", &inputNum);
	initNIL();

	for(loop = 0; loop < inputNum; ++loop)
	{
		scanf("%s %d", command, &key);
		if (command[0] == 'i')
		{
			insertkey(key);
		}else if( command[0] == 'd'){
			deletekey(key);
		}else if( command[0] == 'F'){
			deleteFirst();
		}else if( command[0] == 'L'){
			deleteLast();
		}
	}

	// ????????????
	x = NIL_TOP.prev;
	while(x->prev != x){
		printf("%d ", x->key );
		x = x->prev;
	}
//	printf("========== END!! (^o^)/ ==========\n");

	return 0;
}

Compiler output:
main.c:11:9: error: unknown type name 'node'
   11 |         node* next;
      |         ^~~~
main.c:12:9: error: unknown type name 'node'
   12 |         node* prev;
      |         ^~~~
main.c:15:1: error: unknown type name 'node'; use 'struct' keyword to refer to the type
   15 | node NIL_TOP;
      | ^~~~
      | struct 
main.c:16:1: error: unknown type name 'node'; use 'struct' keyword to refer to the type
   16 | node NIL_END;
      | ^~~~
      | struct 
main.c: In function 'initNIL':
main.c:19:16: error: request for member 'key' in something not a structure or union
   19 |         NIL_TOP.key = 0;
      |                ^
main.c:20:16: error: request for member 'next' in something not a structure or union
   20 |         NIL_TOP.next = &NIL_TOP;
      |                ^
main.c:21:16: error: request for member 'prev' in something not a structure or union
   21 |         NIL_TOP.prev = &NIL_END;
      |                ^
main.c:22:16: error: request for member 'key' in something not a structure or union
   22 |         NIL_END.key = 0;
      |                ^
main.c:23:16: error: request for member 'next' in something not a structure or union
   23 |         NIL_END.next = &NIL_TOP;
      |                ^
main.c:24:16: error: request for member 'prev' in something not a structure or union
   24 |         NIL_END.prev = &NIL_END;
      |                ^
main.c: At top level:
main.c:29:9: error: unknown type name 'node'; use 'struct' keyword to refer to the type
   29 |         node* x = (node*)malloc(sizeof(node));
      |         ^~~~
      |         struct 
main.c:29:20: error: 'node' undeclared here (not in a function)
   29 |         node* x = (node*)malloc(sizeof(node));
      |                    ^~~~
main.c:29:25: error: expected expression before ')' token
   29 |         node* x = (node*)malloc(sizeof(node));
      |                         ^
main.c:30:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
   30 |         x->key = key;
      |          ^~
main.c:31:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
   31 |         x->next = &NIL_TOP;
      |          ^~
main.c:32:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
   32 |         x->prev =  NIL_TOP.prev;
      |          ^~
main.c:33:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   33 |         NIL_TOP.prev->next = x;
      |                ^
main.c:34:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   34 |         NIL_TOP.prev = x;
      |                ^
main.c:36:1: error: expected identifier or '(' before '}' token
   36 | }
      | ^
main.c: In function 'deletekey':
main.c:40:26: error: request for member 'prev' in something not a structure or union
   40 |         node* x = NIL_TOP.prev;
      |                          ^
main.c:41:16: error: request for member 'prev' in something not a structure or union
   41 |         while(x->prev != x){
      |                ^~
main.c:42:21: error: request for member 'key' in something not a structure or union
   42 |                 if(x->key == searchkey){
      |                     ^~
main.c:44:26: error: request for member 'next' in something not a structure or union
   44 |                         x->next->prev = x->prev;
      |                          ^~
main.c:44:42: error: request for member 'prev' in something not a structure or union
   44 |                         x->next->prev = x->prev;
      |                                          ^~
main.c:45:26: error: request for member 'prev' in something not a structure or union
   45 |                         x->prev->next = x->next;
      |                          ^~
main.c:45:42: error: request for member 'next' in something not a structure or union
   45 |                         x->prev->next = x->next;
      |                                          ^~
main.c:46:25: error: unknown type name 'delete'
   46 |                         delete x;
      |                         ^~~~~~
main.c:49:30: error: request for member 'prev' in something not a structure or union
   49 |                         x = x->prev;
      |                              ^~
main.c: In function 'deleteFirst':
main.c:56:26: error: request for member 'prev' in something not a structure or union
   56 |         node* x = NIL_TOP.prev;
      |                          ^
main.c:57:10: error: request for member 'next' in something not a structure or union
   57 |         x->next->prev = x->prev;
      |          ^~
main.c:57:26: error: request for member 'prev' in something not a structure or union
   57 |         x->next->prev = x->prev;
      |                          ^~
main.c:58:10: error: request for member 'prev' in something not a structure or union
   58 |         x->prev->next = x->next;
      |          ^~
main.c:58:26: error: request for member 'next' in something not a structure or union
   58 |         x->prev->next = x->next;
      |                          ^~
main.c:59:9: error: unknown type name 'delete'
   59 |         delete x;
      |         ^~~~~~
main.c: In function 'deleteLast':
main.c:64:26: error: request for member 'next' in something not a structure or union
   64 |         node* x = NIL_END.next;
      |                          ^
main.c:65:10: error: request for member 'next' in something not a structure or union
   65 |         x->next->prev = x->prev;
      |          ^~
main.c:65:26: error: request for member 'prev' in something not a structure or union
   65 |         x->next->prev = x->prev;
      |                          ^~
main.c:66:10: error: request for member 'prev' in something not a structure or union
   66 |         x->prev->next = x->next;
      |          ^~
main.c:66:26: error: request for member 'next' in something not a structure or union
   66 |         x->prev->next = x->next;
      |                          ^~
main.c:67:9: error: unknown type name 'delete'
   67 |         delete x;
      |         ^~~~~~
main.c: In function 'main':
main.c:87:25: error: implicit declaration of function 'insertkey' [-Wimplicit-function-declaration]
   87 |                         insertkey(key);
      |                         ^~~~~~~~~
main.c:98:20: error: request for member 'prev' in something not a structure or union
   98 |         x = NIL_TOP.prev;
      |                    ^
main.c:99:16: error: request for member 'prev' in something not a structure or union
   99 |         while(x->prev != x){
      |                ^~
main.c:100:32: error: request for member 'key' in something not a structure or union
  100 |                 printf("%d ", x->key );
      |                                ^~
main.c:101:22: error: request for member 'prev' in something not a structure or union
  101 |                 x = x->prev;
      |                      ^~