Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
  NodePointer x = nil->next;
  while(x->key != key){
    if(x == nil) break;
x = x->next; }
return x; }
void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}
void printList(){
  NodePointer cr = nil->next;
  int isl = 1;
  while(1){
    if (cr == nil) {
      break;
    }
    if (isl == 0) {
      printf(" ");
    }
    printf("%d", cr->key);
    cr = cr->next;
    isl = 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 x = nil->prev;
  if(x == nil) return;
  deleteNode(x);
}
void delete(int key){
  NodePointer x;
   x = listSearch(key);
  if(x == nil) return;
  deleteNode(x);
}
 void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  x->prev = nil;
  nil->next = x;
  x->next->prev = x;
}
int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int nop = 0, nod = 0;
  scanf("%d", &n);
  init();
  for(i = 0; i < n; i++){
    scanf("%s%d", com, &key);
    if (com[0] == ’i’) {
      insert(key);
      nop++;
      size++;
    } else if (com[0] == ’d’) {
      if (strlen(com) > 6) {
        if (com[6] == ’F’) deleteFirst();
        else if (com[6] == ’L’) deleteLast();
      } else {
    delete(key); nod++;
      }
size--; }
}
  printList();
return 0; }


Compiler output:
main.c: In function 'main':
main.c:77:19: error: stray '\342' in program
   77 |     if (com[0] == <U+2019>i<U+2019>) {
      |                   ^~~~~~~~
main.c:77:21: error: stray '\342' in program
   77 |     if (com[0] == <U+2019>i<U+2019>) {
      |                            ^~~~~~~~
main.c:81:26: error: stray '\342' in program
   81 |     } else if (com[0] == <U+2019>d<U+2019>) {
      |                          ^~~~~~~~
main.c:81:28: error: stray '\342' in program
   81 |     } else if (com[0] == <U+2019>d<U+2019>) {
      |                                   ^~~~~~~~
main.c:81:27: error: 'd' undeclared (first use in this function)
   81 |     } else if (com[0] == ’d’) {
      |                           ^
main.c:81:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:83:23: error: stray '\342' in program
   83 |         if (com[6] == <U+2019>F<U+2019>) deleteFirst();
      |                       ^~~~~~~~
main.c:83:25: error: stray '\342' in program
   83 |         if (com[6] == <U+2019>F<U+2019>) deleteFirst();
      |                                ^~~~~~~~
main.c:83:24: error: 'F' undeclared (first use in this function)
   83 |         if (com[6] == ’F’) deleteFirst();
      |                        ^
main.c:84:28: error: stray '\342' in program
   84 |         else if (com[6] == <U+2019>L<U+2019>) deleteLast();
      |                            ^~~~~~~~
main.c:84:30: error: stray '\342' in program
   84 |         else if (com[6] == <U+2019>L<U+2019>) deleteLast();
      |                                     ^~~~~~~~
main.c:84:29: error: 'L' undeclared (first use in this function)
   84 |         else if (com[6] == ’L’) deleteLast();
      |                             ^