criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <list>
#include <algorithm>
using namespace std;

int main(){
    int q,x;
    string command;

    list<int> v;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        cin >> command;
        if(command == "insert"){
            cin >> x;
            v.push_front(x);
        }else if(command == "deleteFirst"){
            v.pop_front();
        }else if(command == "deleteLast"){
            v.pop_back();
        }else if(command == "delete"){
            cin >> x;
            for (auto itr = v.begin(); itr != v.end() ; it++) {
                if(*it == x){
                    v.erase(it);
                    break;
                }
            }
        }
    }
    int i = 0;
    for(auto itr = v.begin(); itr != v.end(); ++itr) {
        if ( i ++) cout << " ";
        cout << *itr;
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:57: error: 'it' was not declared in this scope; did you mean 'itr'?
   23 |             for (auto itr = v.begin(); itr != v.end() ; it++) {
      |                                                         ^~
      |                                                         itr
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 256

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

void insert(DoublyLinkedList *dll, int value){
  DoublyLinkedList *newNode = (DoublyLinkedList *) malloc(sizeof(DoublyLinkedList));
  newNode->prev = dll;
  newNode->next = dll->next;
  newNode->value = value;
  dll->next->prev = newNode;
  dll->next = newNode;
}

void delete(DoublyLinkedList *dll, int value){
  int nextValue = dll->next->value;
  if(nextValue == value){
    free(dll->next);
    dll->next = dll->next->next;
    dll->next->prev = dll;
  }else if(nextValue != -1){
    delete(dll->next, value);
  }
}

void deleteFirst(DoublyLinkedList *dll){
  if(dll->next->value != -1){
    free(dll->next);
    dll->next = dll->next->next;
    dll->next->prev = dll;
  }
}

void deleteLast(DoublyLinkedList *dll){
  if(dll->prev->value != -1){
    free(dll->prev);
    dll->prev = dll->prev->prev;
    dll->prev->next = dll;
  }
}

void printAll(DoublyLinkedList *dll){
  if(dll->next->value != -1){
    if(dll->value != -1){
      printf("%d ", dll->value);
    }
    printAll(dll->next);
  }else{
    printf("%d\n", dll->value);
  }
}

int main(){
  int i, n, value = 0;
  char line[MAX], buf[MAX];
  char *cmd, *tmp;
  DoublyLinkedList dll;

  dll.prev = &dll;
  dll.next = &dll;
  dll.value = -1;

  scanf("%d", &n);
  fgets(buf, sizeof(buf), stdin);
  for(i = 0; i < n; i++){
    fgets(line, sizeof(line), stdin);
    strtok(line, "\n\0");

    cmd = strtok(line, " ");
    tmp = strtok(NULL, " ");
    if(tmp != NULL){
      value = atoi(tmp);
    }
    if(!strcmp(cmd, "insert")){
      insert(&dll, value);
    }else if(!strcmp(cmd, "delete")){
      delete(&dll, value);
    }else if(!strcmp(cmd, "deleteFirst")){
      deleteFirst(&dll);
    }else if(!strcmp(cmd, "deleteLast")){
      deleteLast(&dll);
    }
  }
  printAll(&dll);

  return 0;
}

Compiler output:
a.cc:21:6: error: expected unqualified-id before 'delete'
   21 | void delete(DoublyLinkedList *dll, int value){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:83:18: error: type 'int' argument given to 'delete', expected pointer
   83 |       delete(&dll, value);
      |             ~~~~~^~~~~~~~
Language: C++

#include "iostream"
#include "stdio.h"
#include "string.h"

using namespace std;

class Node {

	int value;
	int next;
	int before;

public:

	void setvalue( int v ) {
		value = v;
	}

	void setnext(int n) {
		next = n;
	}
	void setbefore( int b ) {
		before = b;
	}
	int getvalue() { return value; }
	int getnext() { return next; }
	int getbefore() { return before; }


};

int main() {

	int num = 0;
	int fast = 0, last = 0;
	int lnum;
	Node no[2000000];

	cin >> lnum;

	for (int i = 0; i < lnum; i++) {
		char com[12];
		int x;
		/*
		cin >> com;
		cin >> x;
		*/
		scanf_s("%s", com);

		if (strcmp(com, "insert") == 0) {
			scanf_s("%d", &x);
			no[num].setvalue(x);
			no[num].setnext(fast);
			no[fast].setbefore(num);

			fast = num;
			num++;
		}
		if (strcmp(com, "delete") == 0) {
			scanf_s("%d", &x);
			int n = fast;
			while (no[n].getvalue() != x) n = no[n].getnext();

			if (n == fast) {
				fast = no[n].getnext();
				no[no[n].getnext()].setbefore(no[n].getbefore());
			}
			else if (n == last) {
				no[no[n].getbefore()].setnext(no[n].getnext());
				last = no[n].getbefore();
			}
			else{
				no[no[n].getbefore()].setnext(no[n].getnext());
				no[no[n].getnext()].setbefore(no[n].getbefore());
			}


		}
		if (strcmp(com, "deleteFirst") == 0) {
			fast = no[fast].getnext();
		}
		if (strcmp(com, "deleteLast") == 0) {
			last = no[last].getbefore();
		}
	}

	int a = fast;
	while (a != last) {
		cout << no[a].getvalue() << " ";
		a = no[a].getnext();
	}
	cout << no[a].getvalue() << endl;
	
	//cin >> fast;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   48 |                 scanf_s("%s", com);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;

struct List
{
	int key;
	List *prev, *next;
};

List root, last;

void Insert(int x)
{
	List *input = (List *)malloc(sizeof(List));
	if (root.next == NULL) {
		root.next = input;
		input->prev = &root;
		input->next = &last;
		last.prev = input;
	}
	else {
		input->next = root.next;
		input->next->prev = input;
		input->prev = &root;
		root.next = input;
	}
	input->key = x;
}

List *SearchLast()
{
	List *ptr = &root;
	while (ptr->next != NULL) {
		ptr = ptr->next;
	}
	return ptr;	
}

//List *SearchKey(int x) 
//{
//	for (List *ptr = root.next; ptr != NULL; ptr = ptr->next)
//		if (ptr->key == x)  return ptr;
//	return NULL;
//}

void Delete(List *ptr)
{
	if (ptr == NULL) return;
	ptr->prev->next = ptr->next;
	if (ptr->next != NULL) ptr->next->prev = ptr->prev;
	free(ptr);
}

void ShowList()
{
	for (List *ptr = root.next; ptr != &last; ptr = ptr->next) {
		printf("%d", ptr->key);
		if (ptr->next != NULL) printf(" ");
	}
	printf("\n");		
}

//void FreeData(List *ptr)
//{
//	if (ptr == NULL) return;
//	FreeData(ptr->next);
//	free(ptr);
//}

int main()
{
	root.next = NULL;
	root.prev = NULL;

	last.next = NULL;
	last.prev = NULL;

	int n, x;
	char order[12];

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%s", order);
		switch (order[0])
		{
		case 'i':
			scanf("%d", &x);
			Insert(x);
			break;
		case 'd':
			switch (strlen(order))
			{
			case 6:
				scanf("%d", &x);
				Delete(SearchKey(x));
				break;
			case 10:
				Delete(last.prev);
				break;
			case 11:
				Delete(root.next);
				break;
			default:
				break;
			}
		default:
			break;
		}
	}
	ShowList();
	//FreeData(&root);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:99:40: error: 'SearchKey' was not declared in this scope
   99 |                                 Delete(SearchKey(x));
      |                                        ^~~~~~~~~
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_p;
  x_p = nil->next;
  while( x_p != nil && x_p->key != key){
    x_p = x_p->next;
  }
  return x_p;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t_p){
  t_p->prev->next = t_p->next;
  t_p->next->prev = t_p->prev;
  if(t_p != nil ){
    free(t_p);
  }
}

void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}

void deleteLast(){
  NodePointer t_p = nil->prev;
  if( t_p == nil){
    return;
  }
  deleteNode(t_p);
}

void delete(int key){
  NodePointer x_p;
  x_p = listSearch(key);
  if( x_p == nil){
    return;
  }
  deleteNode(x_p);
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
  return;
}

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 {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:25:15: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   25 |   nil = malloc(sizeof(struct node));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc: At global scope:
a.cc:65:6: error: expected unqualified-id before 'delete'
   65 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'void insert(int)':
a.cc:77:13: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   77 |   x = malloc(sizeof(struct node));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc: In function 'int main()':
a.cc:101:16: error: type 'int' argument given to 'delete', expected pointer
  101 |         delete(key); nd++;
      |               ~^~~~
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_p;
  x_p = nil->next;
  while( x_p != nil && x_p->key != key){
    x_p = x_p->next;
  }
  return x_p;
}

void init(){
  nil = (NodePointer)malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t_p){
  t_p->prev->next = t_p->next;
  t_p->next->prev = t_p->prev;
  if(t_p != nil ){
    free(t_p);
  }
}

void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}

void deleteLast(){
  NodePointer t_p = nil->prev;
  if( t_p == nil){
    return;
  }
  deleteNode(t_p);
}

void delete(int key){
  NodePointer x_p;
  x_p = listSearch(key);
  if( x_p == nil){
    return;
  }
  deleteNode(x_p);
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
  return;
}

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 {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
a.cc:65:6: error: expected unqualified-id before 'delete'
   65 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'void insert(int)':
a.cc:77:13: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   77 |   x = malloc(sizeof(struct node));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc: In function 'int main()':
a.cc:101:16: error: type 'int' argument given to 'delete', expected pointer
  101 |         delete(key); nd++;
      |               ~^~~~
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 cur = nil->next;
  while(cur != nil && cur->key != key){
    cur = cur->next;
  }
  return cur;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
  if(t == nil)return;
  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(){
  deleteNode(nil->prev);
}

void delete(int key){
  deleteNode(listSearch(key));
}


void insert(int key){
  NodePointer x;
  x = 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 {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:24:15: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   24 |   nil = malloc(sizeof(struct node));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc: At global scope:
a.cc:59:6: error: expected unqualified-id before 'delete'
   59 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'void insert(int)':
a.cc:66:13: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   66 |   x = malloc(sizeof(struct node));
      |       ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |             |
      |             void*
a.cc: In function 'int main()':
a.cc:90:16: error: type 'int' argument given to 'delete', expected pointer
   90 |         delete(key); nd++;
      |               ~^~~~
Language: C++

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_C&lang=jp
#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

class Node{
public:
    int key;
    Node *prev, *next;
};

Node *nil;
// ??????

Node* listSearch(int key){
  // Node????????????????????????
  Node *cur = nil->next;
  // ??????????¬????????´?????????????
  while(cur != nil && cur->key != key){
    cur = cur->next;
  }
  return cur;
}

void init(){
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
  return;
}

void printList(){
  Node *cur = nil->next;
  int isf = 0;
  while (1) {
    if(cur == nil) break;
    if(isf++ > 0) printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  return;
}

void deleteNode(Node *t){
  if(t == nil) return;
  // t??????????????´?????????????????????
  t->prev->next=t->next;
  t->next->prev=t->prev;
  free(t);
  return;
}

void deleteFirst(){
  deleteNode(nil->next);
  return;
}

void deleteLast(){
  deleteNode(nil->prev);
  return;
}

void deleteKey(int key){
  deleteNode(listSearch(key));
  return;
}

void insert(int key){
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  // ???????????´??????????´??????????

  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
  return;
}

int main(){
  int key, n;
  int size = 0;
  char com[20];

  int np=0, nd=0;
  scanf("%d\n",&n);

  init();
  for(int i=0; i<n; i++)
  {
    scanf("%s%d\n", 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--;
    }
  }
  printList();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:12: error: 'strlen' was not declared in this scope
  101 |         if(strlen(com) > 6)
      |            ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdio>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <iostream>
#include <list>
using namespace std;
void output(list<int> a);
int main(void){
	int n;
	int count=0;
	cin >> n;
	list<int> a(n);
	list<int> b(n);
	for(int i=0 ; i< n; i++){
		cin >> a[i];
	}
	for(int i=0 ; i < n; i++){
		for(int j=0 ; j < n; j++){
			if (a[i] < a[j]){
				b[i] = a[i];
				a[i] = a[j];
				a[j] = b[i];
				count++;
			}
		}
		
	}
	output(a);
	cout << count << endl;

	return 0;
	
}

void output(list<int> a){
	for(size_t i=0 ; i< a.size(); i++){
		cout << a[i];
		if( i < a.size()-1){
			cout <<" ";
		}
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   12 |                 cin >> a[i];
      |                         ^
a.cc:16:30: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   16 |                         if (a[i] < a[j]){
      |                              ^
a.cc:16:37: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   16 |                         if (a[i] < a[j]){
      |                                     ^
a.cc:17:34: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   17 |                                 b[i] = a[i];
      |                                  ^
a.cc:17:41: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   17 |                                 b[i] = a[i];
      |                                         ^
a.cc:18:34: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   18 |                                 a[i] = a[j];
      |                                  ^
a.cc:18:41: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   18 |                                 a[i] = a[j];
      |                                         ^
a.cc:19:34: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   19 |                                 a[j] = b[i];
      |                                  ^
a.cc:19:41: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int')
   19 |                                 a[j] = b[i];
      |                                         ^
a.cc: In function 'void output(std::__cxx11::list<int>)':
a.cc:34:26: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'size_t' {aka 'long unsigned int'})
   34 |                 cout << a[i];
      |                          ^
Language: C++

#include <iostream>
#include <list>
using namespace std;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    list<int> List;   //?????????
    int CommandNum;     //????????°
    string Command;
    int Number;
    
    List.clear();
    
    cin >> CommandNum;
    
    for(int i = 0; i < CommandNum; i++){
        cin >> Command;
        if(Command == "insert"){    //??????????????\
            cin >> Number;
            List.push_front(Number);
        } else if(Command == "delete"){ //????????????????????????
            cin >> Number;
            list<int>::iterator it = find(List.begin(), List.end(), Number);
            if(it != List.end())    List.erase(it);
        } else if(Command == "deleteFirst"){    //????????????
            List.pop_front();
        } else{ //????°???????
            List.pop_back();
        }
    }
    
    for(list<int>::iterator it = List.begin(); it != List.end(); it++){
        if(it != List.begin())   cout << " ";
        cout << *it;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:42: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
   25 |             list<int>::iterator it = find(List.begin(), List.end(), Number);
      |                                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:25:42: note:   'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   25 |             list<int>::iterator it = find(List.begin(), List.end(), Number);
      |                                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <list>
#include <cstdio>
using namespace std;
int Q, a; char c[14]; list<int> l;
int main() {
	scanf("%d", &Q);
	for(int i = 0; i < Q; i++) {
		scanf("%s", c);
		switch(c[0] + c[6]) {
		case 105: scanf("%d", &a), l.push_front(a); break;
		case 170: l.pop_front(); break;
		case 176: l.pop_back(); break;
		default:
			scanf("%d", &a);
			for(list<int>::iterator it = l.begin(); it != l.end(); it++) {
				if(*it == a) {
					l.delete(it); break;
				}
			}
		}
	}
	for(list<int>::iterator it = l.begin(); it != l.end(); it++) printf("%d\n", *it);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: expected unqualified-id before 'delete'
   17 |                                         l.delete(it); break;
      |                                           ^~~~~~
Language: C++

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
using namespace std;

typedef struct node {
    struct node* prev;
    struct node* next;
    int data;
} node_t;

void print_list(node_t* head) {
    node_t* node = head->next;
    while(node) {
        printf("%d", node->data);
        // cout << node->data;
        node = node->next;
        if (node) {
            printf("%s", " ");
        }
    }
    cout << endl;
}

node_t* init() {
    node_t* head = (node_t*)malloc(sizeof(node_t));
    head->prev = NULL;
    head->next = NULL;
    head->data = -1;
    return head;
}

node_t* insert(node_t* head, int data) {
    node_t* node = (node_t*)malloc(sizeof(node_t));
    node->data = data;
    node->prev = head;
    node->next = head->next;
    head->next = node;
    if (node->next) {
        node->next->prev = node;
    } else {
        head->prev = node;
    }
    return node;
}

int delete_key(node_t* head, int key) {
    node_t* node = head->next;
    while(node) {
        if (node->data == key) {
            node->prev->next = node->next;
            if (node->next) {
                node->next->prev = node->prev;
            } else {
                head->prev = node->prev;
            }
            free(node);
            return 1;
        }
        node = node->next;
    }
    return -1;
}

int delete_first(node_t* head) {
    node_t* node = head->next;
    if (node->next != NULL)
        node->next->prev = head;
    head->next = node->next;
    free(node);
    return 1;
}

int delete_last(node_t* head) {
    node_t* node = head->prev;
    if (node->prev != NULL)
        node->prev->next = NULL;
    head->prev  = node->prev;
    free(node);
    return 1;
}

int getKey(char* str, int length) {
    int key = 0;
    int l = length - 2;
    char c = str[l];
    int cnt = 1;
    while (c != ' ') {
        int v = c - '0';
        key += v * cnt;
        cnt *= 10;
        c = str[--l];
    }
    return key;
}

int main() {
    int n = 0;
    scanf("%d", &n);
    getchar();
    node_t* list = init();
    fflush(stdin);
    for(int i = 0; i < n; i++) {
        char str[20];
        fgets(str, sizeof(str), stdin);
        int len = strlen(str);
        if (str[6] == ' ') {
            if (str[0] == 'i') {
                insert(list, getKey(str, len));
                continue;
            }
            delete_key(list, getKey(str, len));
            continue;
        }

        if (len == 12) {
            delete_first(list);
            continue;
        }
        delete_last(list);
    }
    print_list(list);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:109:19: error: 'strlen' was not declared in this scope
  109 |         int len = strlen(str);
      |                   ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <vector>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include<iostream>
#include<string>

using namespace std;

class ele
{
public:
	int key;
	ele *prev, *next;
};

ele *null = new ele;

void insert(int n)
{
	ele *node = new ele;
	node->key = n;
	node->prev = null;
	node->next = null->next;
	null->next->prev = node;
	null->next = node;
}

ele* search(int n)
{
	ele *ser = new ele;
	ser = null->next;
	while (ser != null&&ser->key != n)
	{
		ser = ser->next;
	}
	return ser;
}

void adelete(ele* a)
{
	if (a == null)return;
	a->prev->next = a->next;
	a->next->prev = a->prev;
	delete a;
}

void searchdelete(int n)
{
	adelete(search(n));
}

void deletefirst()
{
	adelete(null->next);
}

void deletelast()
{
	adelete(null->prev);
}
	
int main()
{
	null->prev = null->next = null;
	int n, i, a;
	string str;
	ele *e = new ele;
	e = null;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++)
	{
		cin >> str;
		if (str == "deleteLast")deletelast();
		else if (str == "deleteFirst")deletefirst();
		else if (str == "insert") { scanf_s("%d", &a); insert(a); }
		else { scanf_s("%d", &a); searchdelete(a); }
	}
	e = e->next;
	while (e != null)
	{
		printf("%d ", e->key);
		e = e->next;
	}
	printf("\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   66 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

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

using namespace std;

class ele
{
public:
	int key;
	ele *prev, *next;
};

ele *null = new ele;

void insert(int n)
{
	ele *node = new ele;
	node->key = n;
	node->prev = null;
	node->next = null->next;
	null->next->prev = node;
	null->next = node;
}

ele* search(int n)
{
	ele *ser = new ele;
	ser = null->next;
	while (ser != null&&ser->key != n)
	{
		ser = ser->next;
	}
	return ser;
}

void adelete(ele* a)
{
	if (a == null)return;
	a->prev->next = a->next;
	a->next->prev = a->prev;
	delete a;
}

void searchdelete(int n)
{
	adelete(search(n));
}

void deletefirst()
{
	adelete(null->next);
}

void deletelast()
{
	adelete(null->prev);
}
	
int main()
{
	null->prev = null->next = null;
	int n, i, a;
	string str;
	ele *e = new ele;
	e = null;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++)
	{
		cin >> str;
		if (str == "deleteLast")deletelast();
		else if (str == "deleteFirst")deletefirst();
		else if (str == "insert") { scanf_s("%d", &a); insert(a); }
		else { scanf("%d", &a); searchdelete(a); }
	}
	e = e->next;
	while (e != null)
	{
		printf("%d ", e->key);
		e = e->next;
	}
	printf("\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   67 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <time.h>
using namespace std;
void insert(int);
void _delete(int);
void deleteFirst(void);
void deleteLast(void);
int Empty_que(void);
#define N 2000020
int li[N], pl[N], pl2[N],first, last, blast = 0, cou = 0, now = 0;
//clock_t starttime, endtime;
int main(void)
{
//	starttime = clock();
	first = last = 0;
	li[0] = -1;
	int n, x;
	int cou_a = 0, cou_b = 0, cou_c = 0, cou_d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string command;
		cin >> command;
		if (command == "insert") {
			cin >> x;
			insert(x); 
			cou_a++;
		}
		if (command == "delete") { 
			cin >> x;
			_delete(x); 
			cou_b++;
		}
		if (command == "deleteFirst") { deleteFirst(); 			cou_c++;}
		if (command == "deleteLast") { deleteLast(); 			cou_d++;}
		}
	for (int i = 0, f = first; li[f] != -1; i++) {
		printf("%d", li[f]);
		if (last == f || li[f] == -1) break;
		f = pl[f];
		printf(" ");
	}
	puts("");
//	printf("%d %d %d %d\n", cou_a, cou_b, cou_c, cou_d);
//	endtime = clock();
//	printf("\n%f\n", (double)(endtime - starttime) / CLOCKS_PER_SEC);
}
void insert(int a)
{
	li[cou] = a;

	pl2[first] = cou;
	pl[cou] = first;
	first = cou;
	if (now == 0) last = cou;
	cou++; now++;
}
void _delete(int a)
{
	int f, fb, fa;
	f = first;
	if (now >= 2) {
		for (int i = 0; i < cou && !(Empty_que()); i++) {
			if (a == li[f]) {
				fa = pl[f]; fb = pl2[f];
				if (f == first) { first = pl[f]; }
				else { pl[fb] = pl[f]; }
				if (f == last) { last = pl2[f]; }
				else { pl2[pl[f]] = pl2[f]; }
				now--;
				break;
			}
			if (f == last) break;
			f = pl[f];
		}
	}
	else {
		last = first = cou = 0;
		li[f] = -1;
		now--;
	}
}
void deleteFirst(void)
{
	if (now >= 2) {
		first = pl[first];
		now--;
	}
	else {
		last = first = cou = 0;
		li[first] = -1;
		now--;
	}
}
void deleteLast(void)
{
	if (now >= 2) {
		last = pl2[last];
		now--;
	}
	else {
		li[last] = -1;
		now--;
	}
}

Compiler output:
/usr/bin/ld: /tmp/cceswu6E.o: in function `_delete(int)':
a.cc:(.text+0x48a): undefined reference to `Empty_que()'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <time.h>
using namespace std;
void insert(int);
void _delete(int);
void deleteFirst(void);
void deleteLast(void);
int Empty_que(void);
#define N 2000020
int li[N], pl[N], pl2[N],first, last, blast = 0, cou = 0, now = 0;
//clock_t starttime, endtime;
int main(void)
{
//	starttime = clock();
	first = last = 0;
	li[0] = -1;
	int n, x;
	int cou_a = 0, cou_b = 0, cou_c = 0, cou_d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string command;
		cin >> command;
		if (command == "insert") {
			cin >> x;
			insert(x); 
			cou_a++;
		}
		if (command == "delete") { 
			cin >> x;
			_delete(x); 
			cou_b++;
		}
		if (command == "deleteFirst") { deleteFirst(); 			cou_c++;}
		if (command == "deleteLast") { deleteLast(); 			cou_d++;}
		}
	for (int i = 0, f = first; li[f] != -1; i++) {
		printf("%d", li[f]);
		if (last == f || li[f] == -1) break;
		f = pl[f];
		printf(" ");
	}
	puts("");
//	printf("%d %d %d %d\n", cou_a, cou_b, cou_c, cou_d);
//	endtime = clock();
//	printf("\n%f\n", (double)(endtime - starttime) / CLOCKS_PER_SEC);
}
void insert(int a)
{
	li[cou] = a;

	pl2[first] = cou;
	pl[cou] = first;
	first = cou;
	if (now == 0) last = cou;
	cou++; now++;
}
void _delete(int a)
{
	int f, fb, fa;
	f = first;
	if (now >= 2) {
		for (int i = 0; i < cou && !(Empty_que()); i++) {
			if (a == li[f]) {
				fa = pl[f]; fb = pl2[f];
				if (f == first) { first = pl[f]; }
				else { pl[fb] = pl[f]; }
				if (f == last) { last = pl2[f]; }
				else { pl2[pl[f]] = pl2[f]; }
				now--;
				break;
			}
			if (f == last) break;
			f = pl[f];
		}
	}
	else {
		last = first = cou = 0;
		li[f] = -1;
		now--;
	}
}
void deleteFirst(void)
{
	if (now >= 2) {
		first = pl[first];
		now--;
	}
	else {
		last = first = cou = 0;
		li[first] = -1;
		now--;
	}
}
void deleteLast(void)
{
	if (now >= 2) {
		last = pl2[last];
		now--;
	}
	else {
		li[last] = -1;
		now--;
	}
}

Compiler output:
/usr/bin/ld: /tmp/ccvZMcHQ.o: in function `_delete(int)':
a.cc:(.text+0x48a): undefined reference to `Empty_que()'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
void insert(int);
void _delete(int);
void deleteFirst(void);
void deleteLast(void);
#define N 2000020
int li[N], pl[N], pl2[N],first, last,, cou = 0, now = 0;
int main(void)
{
	first = last = 0;
	li[0] = -1;
	int n, x;
	int cou_a = 0, cou_b = 0, cou_c = 0, cou_d = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string command;
		cin >> command;
		if (command == "insert") {
			cin >> x;
			insert(x); 
			cou_a++;
		}
		if (command == "delete") { 
			cin >> x;
			_delete(x); 
			cou_b++;
		}
		if (command == "deleteFirst") { deleteFirst(); 			cou_c++;}
		if (command == "deleteLast") { deleteLast(); 			cou_d++;}
		}
	for (int i = 0, f = first; ; i++) {
		printf("%d", li[f]);
		if (last == f || li[f] == -1) break;
		f = pl[f];
		printf(" ");
	}
	puts("");
}
void insert(int a)
{
	li[cou] = a;
	pl2[first] = cou;
	pl[cou] = first;
	first = cou;
	if (now == 0) last = cou;
	cou++; now++;
}
void _delete(int a)
{
	int f, fb, fa;
	f = first;
	if (now >= 2) {
		for (int i = 0; i < cou && now != 0; i++) {
			if (a == li[f]) {
				fa = pl[f]; fb = pl2[f];
				if (f == first) { first = pl[f]; }
				else { pl[fb] = pl[f]; }
				if (f == last) { last = pl2[f]; }
				else { pl2[pl[f]] = pl2[f]; }
				now--;
				break;
			}
			if (f == last) break;
			f = pl[f];
		}
	}
	else {
		last = first = cou = 0;
		li[f] = -1;
		now--;
	}
}
void deleteFirst(void)
{
	if (now >= 2) {
		first = pl[first];
		now--;
	}
	else {
		last = first = cou = 0;
		li[first] = -1;
		now--;
	}
}
void deleteLast(void)
{
	if (now >= 2) {
		last = pl2[last];
		now--;
	}
	else {
		li[last] = -1;
		now--;
	}
}

Compiler output:
a.cc:10:38: error: expected unqualified-id before ',' token
   10 | int li[N], pl[N], pl2[N],first, last,, cou = 0, now = 0;
      |                                      ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
#define F_L_NUMBER -1
void insert(int);
void _delete(int);
void deleteFirst(void);
void deleteLast(void);
#define N 2000020
struct list
{
	int li;
	list *pl, *pl2;
};
int cou = 0,now = 0;
list L[N], first, last;
int main(void)
{
	int n, x;
	list *f;
	first.li = F_L_NUMBER;
	first.pl = &last;
	last.li = F_L_NUMBER;
	last.pl2 = &first;
	scanf("%d",&n);
	for (int i = 0; i < n; i++) {
		string command;
		cin << string;
		if (command == "insert") {
			scanf("%d",&n);
			insert(x);
		}
		if (command == "delete") {
			scanf("%d",&n);
			_delete(x);
		}
		if (command == "deleteFirst") { deleteFirst(); }
		if (command == "deleteLast") { deleteLast(); }
		f = first.pl;
	}
	for (int i = 0; ; i++) {
		printf("%d", f->li);
		if (last.pl2 == f) break;
		f = f->pl;
		printf(" ");
	}
	printf("\n");
}
void insert(int a)
{
	L[cou].li = a;
	L[cou].pl2 = &first;
	L[cou].pl = first.pl;;
	first.pl->pl2 = &L[cou]; 
	first.pl = &L[cou];
	cou++; now++;
}
void _delete(int a)
{
	list *f, *fb, *fa;
	f = first.pl;
	if (now >= 1) {
		for (int i = 0; ; i++) {
			if (a == f -> li) {
				fa = f->pl; fb = f->pl2;
				fb->pl = fa;
				fa->pl2 = fb;
				now--;
				break;
			}
			if (last.pl2 == f) break;
			f = f->pl;
		}
	}
}
void deleteFirst(void)
{
	if (now >= 1) {
		list *fa;
		fa = first.pl;
		fa->pl->pl2 = &first;
		first.pl = fa->pl; 
		now--;
	}
}
void deleteLast(void)
{
	if (now >= 1) {
		list *fb;
		fb = last.pl2;
		fb->pl2->pl = &last;
		last.pl2 = fb->pl2;
		now--;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:30: error: expected primary-expression before ';' token
   29 |                 cin << string;
      |                              ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;

vector<int> Command(vector<int> X, string c){
	vector<int> Y;
	if(c == "insert"){
		long int d;
		cin >> d;
		Y.push_back(d);
		for(int j = 0; j < X.size(); j++){
			Y.push_back(X[j]);
		}
	}else if(c == "delete"){
		long int d;
		cin >> d;
		int i;
		for(int j = 0; j < X.size(); j++){
			if(X[j] == d) i = j, break;
		}
		for(int j = 0; j < X.size(); j++){
			if(j != i) Y.push_back(X[j]);
		}
	}else if(c == "deleteFirst"){
		for(int j = 1; j < X.size(); j++){
			Y.push_back(X[j]);
		}
	}else if(c == "deleteLast"){
		for(int j = 0; j < X.size() - 1; j++){
			Y.push_back(X[j]);
		}
	}
	return Y;
}

int main(){
	int n;
	cin >> n;
	vector<int> X;
	for(int i = 0; i < n; i++){
		string c;
		cin >> c;
		X = Command(X, c);	
	}
	for(int i = 0; i < X.size(); i++){
		if(i != X.size() - 1) cout << X[i] << ' ';
		if(i == X.size() - 1) cout << X[i] << endl;
	}	
	return 0;
}

Compiler output:
a.cc: In function 'std::vector<int> Command(std::vector<int>, std::string)':
a.cc:20:46: error: expected primary-expression before 'break'
   20 |                         if(X[j] == d) i = j, break;
      |                                              ^~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>

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

Node *nil;

Node* listSearch(int key){
  Node *cur = nil->next;
  while (cur != nil && cur->key != key){
    cur - cur->next;
  }
  return cur;
}

void iii(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void plist(void){
  Node *cur = nil->next;
  int isf = 0;
  while(1){
    if(cur==nil)break;
    if(isf++>0)
      printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void ddd(Node *t){
  if(t==nil) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void insert(int key){
  Node *x = (Node *)malloc(sizeof(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, np=0, nd=0;
  char com[20];

  scanf("%d",&n);
  iii();
  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')
          ddd(nil->next);
        else if(com[6]=='L')
          ddd(nil->prev);
      } else {
        ddd(listSearch(key));
        nd++;
      }
      size--;
    }
  }
  plist();
  return 0;
}

Compiler output:
a.cc: In function 'void insert(int)':
a.cc:50:17: error: 'next' was not declared in this scope
   50 |   x->next = nil-next;
      |                 ^~~~
a.cc:51:22: error: 'struct Node' has no member named 'x'
   51 |   nil->next->prev -> x;
      |                      ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>

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

Node *nil;

Node* listSearch(int key){
  Node *cur = nil->next;
  while (cur != nil && cur->key != key){
    cur - cur->next;
  }
  return cur;
}

void iii(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void plist(void){
  Node *cur = nil->next;
  int isf = 0;
  while(1){
    if(cur==nil)break;
    if(isf++>0)
      printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void ddd(Node *t){
  if(t==nil) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void insert(int key){
  Node *x = (Node *)malloc(sizeof(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, np=0, nd=0;
  char com[20];

  scanf("%d",&n);
  iii();
  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')
          ddd(nil->next);
        else if(com[6]=='L')
          ddd(nil->prev);
      } else {
        ddd(listSearch(key));
        nd++;
      }
      size--;
    }
  }
  plist();
  return 0;
}

Compiler output:
a.cc: In function 'void insert(int)':
a.cc:50:17: error: 'next' was not declared in this scope
   50 |   x->next = nil-next;
      |                 ^~~~
Language: C++

#include <algorithm>
#include <deque>
#include <iostream>
#include <list>
#include <string>

int main(int argc, char const *argv[])
{
    int n;
    std::cin >> n;

    std::string command;
    int key;
    std::deque<int> l;
    for (int i = 0; i < n; i++) {
        std::cin >> command;
        if (command[0] == "i") {
            std::cin >> key;
            l.push_front(key);
        } else if (command.size() == 6) {
            std::cin >> key;
            std::deque<int>::iterator itr = find(l.begin(), l.end(), key);
            if (itr != l.end()) l.erase(itr);
        } else if (command[7] == "F") {
            l.pop_front();
        } else if (command[7] == "L") {
            l.pop_back();
        }
    }

    for (int i = 0; i < l.size() - 1; i++) {
        std::cout << l[i] << " ";
    }
    std::cout << l.back() << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:17:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |         if (command[0] == "i") {
a.cc:24:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |         } else if (command[7] == "F") {
a.cc:26:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |         } else if (command[7] == "L") {
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  list<int> lst;
  int n;
  cin >> n;
  string query;
  int key;
  list<int>::iterator itr;
  while(n--);
    cin >> query;
    if(query == "insert"){
      cin >> key;
      lst.push_front(key);
    }else if(query == "delete"){
      cin >> key;
      for(itr = lst.begin();itr != lst.end();itr++){
	if(*itr == key){lst.erase(itr);break;}
      }
    }else if(query == "deleteFirst")lst.pop_front();
    else if(query == "deleteLast")lst.pop_back();
  }
  for(itr = lst.begin();itr != --lst.end();itr++){
    cout << *itr << " ";
  }
  cout << *itr;
  return 0;
}

Compiler output:
a.cc:23:3: error: expected unqualified-id before 'for'
   23 |   for(itr = lst.begin();itr != --lst.end();itr++){
      |   ^~~
a.cc:23:25: error: 'itr' does not name a type
   23 |   for(itr = lst.begin();itr != --lst.end();itr++){
      |                         ^~~
a.cc:23:44: error: 'itr' does not name a type
   23 |   for(itr = lst.begin();itr != --lst.end();itr++){
      |                                            ^~~
a.cc:26:3: error: 'cout' does not name a type
   26 |   cout << *itr;
      |   ^~~~
a.cc:27:3: error: expected unqualified-id before 'return'
   27 |   return 0;
      |   ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<string>
using namespace std;
class Node {
public:
	int key;
	Node *prev, *next;
};
Node *nil;
Node* listSearch(int key) {
	Node *cur = nil->next;
	while (cur != nil&&cur->key != key) {
		cur = cur->next;
	}
	return cur;
}
void init() {
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}
void printList() {
	Node *cur = nil->next;
	int isf = 0;
	while (true) {
		if (cur == nil)break;
		if (isf++ > 0)printf(" ");
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}
void deleteNode(Node *t) {
	if (t == nil)return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}
void deleteFirst() {
	deleteNode(nil->next);
}
void deleteLast() {
	deleteNode(nil->prev);
}
void deleteKey(int key) {
	deleteNode(listSearch(key));
}
void insert(int key) {
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;
	x->prev = nil;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
}
int main() {
	init();
	int n, key;
	string s;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s;
		if (s == "insert") {
			scanf_s("%d", &key);
			insert(key);
		}
		else if (s == "delete") {
			scanf_s("%d", &key);
			deleteKey(key);
		}
		else if (s == "deleteFirst") {
			deleteFirst();
		}
		else if (s == "deleteLast") {
			deleteLast();
		}
	}
	printList();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   66 |                         scanf_s("%d", &key);
      |                         ^~~~~~~
      |                         scanf
a.cc:70:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   70 |                         scanf_s("%d", &key);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
class Node {
public:
	int key;
	Node *prev, *next;
};
Node *nil;
Node* listSearch(int key) {
	Node *cur = nil->next;
	while (cur != nil&&cur->key != key) {
		cur = cur->next;
	}
	return cur;
}
void init() {
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}
void printList() {
	Node *cur = nil->next;
	int isf = 0;
	while (true) {
		if (cur == nil)break;
		if (isf++ > 0)printf(" ");
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}
void deleteNode(Node *t) {
	if (t == nil)return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}
void deleteFirst() {
	deleteNode(nil->next);
}
void deleteLast() {
	deleteNode(nil->prev);
}
void deleteKey(int key) {
	deleteNode(listSearch(key));
}
void insert(int key) {
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;
	x->prev = nil;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
}
int main() {
	init();
	int n, key;
	char com[20];
	scanf_s("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf_s("%s%d", com, &key);
		if (com[0] == 'i') {
			insert(key);
		}
		else if (com[0] == 'd') {
			if (strlen(com) > 6) {
				if (com[6] == 'F')deleteFirst();
				else if (com[6] == 'L')deleteLast();
			}
			else {
				deleteKey(key);
			}
		}
		
	}
	printList();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   63 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
#include<list>
#include<string>

using namespace std;

void Output(list<int> ilist)
{
	list<int>::iterator it = ilist.begin();
	cout << *it;
	it++;
	while(it != ilist.end()){
		cout << " " << *it;
		it++;
	}
	cout << endl;
}

list<int> DealDelete(int key,list<int> ilist)
{
	list<int>::iterator it = ilist.begin();
	
	while(it != ilist.end()){
		if(*it == key){
			ilist.erase(it);
			return ilist;
		}
		it++;
	}
	return ilist
}

list<int> Deal(string command,list<int> ilist)//??\???????????£??????????????¨????±???????
{
	if(command == "insert"){
		int key;
		cin >> key;
		ilist.push_front(key);
	}else if(command == "delete"){
		int key;
		cin >> key;
		ilist = DealDelete(key,ilist);
	}else if(command == "deleteFirst"){
		ilist.pop_front();
	}else{
		ilist.pop_back();
	}
	return ilist;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	list<int> ilist;
	
	cin >> n;
	
	for(int i=0; i<n; i++){
		string command;
		cin >> command;
		ilist = Deal(command,ilist);//??\???????????????
	}
	Output(ilist);//??¨?????????
}

Compiler output:
a.cc: In function 'std::__cxx11::list<int> DealDelete(int, std::__cxx11::list<int>)':
a.cc:30:21: error: expected ';' before '}' token
   30 |         return ilist
      |                     ^
      |                     ;
   31 | }
      | ~