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

#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>

using namespace std;

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

Node *nil;

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

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;
}

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

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));
}

int main(){
	int n,key;
	char com[20];
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%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);
			}
		}
	}
	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");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:29: error: 'strlen' was not declared in this scope
   68 |                         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<stdlib.h>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <iostream>
#include <list>

using namespace std;

int main(){
	int n, x;
	string command;
	list<int> lst;

	cin >> n;

	while (n-- > 0) {
		cin >> command;

		if (command == "insert") {
			cin >> x;
			lst.push_front(x);
		}
		else if (command == "delete") {
			cin >> x;
			for (auto itr = lst.begin(); itr != lst.end(); ++itr) {
				if (*itr == x)
					lst.erase(itr);
			}
		}
		else if (command == "deleteFirst" ) {
			lst.pop_front();
		}
		else if (command == "deleteLast" ) {
			lst.pop_back();
		}
	}

	cout << *(lst.begin());
	for_each(next(lst.cbegin()), lst.cend(), [](int x){cout << ' ' << x;});
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'for_each' was not declared in this scope
   36 |         for_each(next(lst.cbegin()), lst.cend(), [](int x){cout << ' ' << x;});
      |         ^~~~~~~~
Language: C++

#include <iostream>
#include <list>

using namespace std;

int main(){
	int n, x;
	string command;
	list<int> lst;

	cin >> n;

	while (n-- > 0) {
		cin >> command;

		if (command == "insert") {
			cin >> x;
			lst.push_front(x);
		}
		else if (command == "delete") {
			cin >> x;
			for (auto itr = lst.begin(); itr != lst.end(); ++itr) {
				if (*itr == x)
					lst.erase(itr);
			}
		}
		else if (command == "deleteFirst" ) {
			lst.pop_front();
		}
		else if (command == "deleteLast" ) {
			lst.pop_back();
		}
	}

	cout << *(lst.begin());
	std::for_each(next(lst.cbegin()), lst.cend(), [](int x){cout << ' ' << x;});
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:14: error: 'for_each' is not a member of 'std'
   36 |         std::for_each(next(lst.cbegin()), lst.cend(), [](int x){cout << ' ' << x;});
      |              ^~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<ctime>
#include<cstdlib>
#include<numeric>
#include<typeinfo>
#include<cstdio>
#include<cctype>
#include<list>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
const int inf=1e8;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000000009

 
int main(void){
	int n,i,j,k;
	cin>>n;
	list<int> l;
	char s[20];
	int x;
	loop(i,0,n){
		scanf("%s",s);
		if(strcmp(s,"insert")==0){
			scanf("%d",&x);
			l.push_front(x);
		}else if(strcmp(s,"delete")==0){
			scanf("%d",&x);
			auto itr = l.begin();
			loop(j,0,l.size()){
				if(*itr==x){
					l.erase(itr);
					break;
				}
				itr++;
			}
		}else if(strcmp(s,"deleteFirst")==0){
			l.pop_front();
		}else{
			l.pop_back();
		}
	}
	if(!l.empty()){
		cout<<*l.begin();
		l.pop_front();
	}
	while(!l.empty()){
		cout<<" "<<*l.begin();

Compiler output:
a.cc: In function 'int main()':
a.cc:65:39: error: expected '}' at end of input
   65 |                 cout<<" "<<*l.begin();
      |                                       ^
a.cc:64:26: note: to match this '{'
   64 |         while(!l.empty()){
      |                          ^
a.cc:65:39: error: expected '}' at end of input
   65 |                 cout<<" "<<*l.begin();
      |                                       ^
a.cc:33:15: note: to match this '{'
   33 | int main(void){
      |               ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<ctime>
#include<cstdlib>
#include<numeric>
#include<typeinfo>
#include<cstdio>
#include<cctype>
#include<list>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
const int inf=1e8;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000000009

int main() {
    /*
    ios::sync_with_stdio(false);
    cin.tie(0);
    */
 
    list<int> li;
    int n;
    scanf("%d", &n);
 
    int x;
    char c[20];
    REP(i, n) {
        scanf("%s", &c);
 
        if (c[0] == 'i') {
            scanf("%d", &x);
            li.push_front(x);
        } else if (c[6] != 'F' && c[6] != 'L') {
            scanf("%d", &x);
            auto it = li.begin();
            while (it != li.end()) {
                if (*it == x) {
                    it = li.erase(it);
                    break;
                }
                it++;
            }
        } else if (c[6] == 'F') {
            li.pop_front();
        } else if (c[6] == 'L') {
            li.pop_back();
        }
    }
 
    auto it = li.begin();
    if (it != li.end()) {
        printf("%d", *it);
        it++;
    }
    while (it != li.end()) {
        printf(" %d", *it);
        it++;
    }
 
    printf("\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: 'i' was not declared in this scope
   44 |     REP(i, n) {
      |         ^
a.cc:44:5: error: 'REP' was not declared in this scope
   44 |     REP(i, n) {
      |     ^~~
Language: C++

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

typedef struct node_s node;

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

node *head;

void insert(int x){
  node *t=malloc(sizeof(node));
  t->key=x;
  t->next=head->next;
  t->prev=head;
  if (head->next!=NULL)head->next->prev=t;
  head->next=t;
}
void delete(node *n){
  n->prev->next=n->next;
  if (n->next!=NULL)n->next->prev=n->prev;
  free(n);
}

node *find(int key){
  node *p;
  for (p=head->next;p!=NULL;p=p->next){
    if (p->key==key){
      return p;
    }
  }
  return NULL;
}

int main(){
  int i,n,x;
  char cmd[16];
  node *tp;
    
  head = malloc(sizeof(node));
  head->key=-1;
  head->prev=NULL;
  head->next=NULL;
  
  scanf("%d",&n);

  for (i=0;i<n;i++){
    scanf("%s", &cmd);
    if (cmd[0]=='i'){
      scanf("%d",&x);
      insert(x);
    }else if (cmd[0]=='d'&&cmd[6]=='\0'){
      scanf("%d",&x);
      delete(find(x));
    }else if (cmd[0]=='d'&&cmd[6]=='F'){
      delete(head->next);
    }else if (cmd[0]=='d'&&cmd[6]=='L'){
      for (tp=head->next;tp->next!=NULL;tp=tp->next);
      delete(tp);
    }

  }
  for (tp=head->next;tp->next!=NULL;tp=tp->next)
    printf("%d " ,tp->key);
  printf("%d\n" ,tp->key);
  
  return 0;
}

Compiler output:
a.cc: In function 'void insert(int)':
a.cc:15:17: error: invalid conversion from 'void*' to 'node*' {aka 'node_s*'} [-fpermissive]
   15 |   node *t=malloc(sizeof(node));
      |           ~~~~~~^~~~~~~~~~~~~~
      |                 |
      |                 void*
a.cc: At global scope:
a.cc:22:6: error: expected unqualified-id before 'delete'
   22 | void delete(node *n){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:43:16: error: invalid conversion from 'void*' to 'node*' {aka 'node_s*'} [-fpermissive]
   43 |   head = malloc(sizeof(node));
      |          ~~~~~~^~~~~~~~~~~~~~
      |                |
      |                void*
Language: C++

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

using namespace std;
	list<int> lst;
int ins(){
	int a; cin >> a;
	lst.push_front(a);
}

int del(){
	int order; cin >> order;
	auto itr = lst.begin;
	int size = lst.size();
	int sanshou;
	for (int i = 0; i < size; i++)
	{
		sanshou = *itr;
		if (sanshou == order){
			lst.erase(itr);
			break;
		}
		itr++;
	}
}

int delf(){
	lst.pop_front;
}

int dele(){
	lst.pop_back;
}

int _tmain(int argc, _TCHAR* argv[])
{
	int dataset; cin >> dataset;
	for (int i = 0; i < dataset; i++)
	{
		string order;
		cin >> order;
		if (order == "insert"){
			ins();
		}
		else if (order == "delete"){
			del();
		}
		else if (order == "deleteFirst"){
			delf();
		}
		else if (order == "deleteLast"){
			dele();
		}
	}
	auto itr = lst.begin();
	for (int i = 0; i < lst.size(); i++)
	{
		if (i != 0){
			cout << " " << *itr;
		}
		else{
			cout << *itr;
		}
		itr++;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int ins()':
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
a.cc: In function 'int del()':
a.cc:14:24: error: unable to deduce 'auto' from 'lst.std::__cxx11::list<int>::begin'
   14 |         auto itr = lst.begin;
      |                    ~~~~^~~~~
a.cc:14:24: note:   couldn't deduce template parameter 'auto'
   14 |         auto itr = lst.begin;
      |                        ^~~~~
a.cc:26:1: warning: no return statement in function returning non-void [-Wreturn-type]
   26 | }
      | ^
a.cc: In function 'int delf()':
a.cc:29:13: error: invalid use of non-static member function 'void std::__cxx11::list<_Tp, _Alloc>::pop_front() [with _Tp = int; _Alloc = std::allocator<int>]'
   29 |         lst.pop_front;
      |         ~~~~^~~~~~~~~
In file included from /usr/include/c++/14/list:65,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_list.h:1300:7: note: declared here
 1300 |       pop_front() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
a.cc: In function 'int dele()':
a.cc:33:13: error: invalid use of non-static member function 'void std::__cxx11::list<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]'
   33 |         lst.pop_back;
      |         ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1349:7: note: declared here
 1349 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:34:1: warning: no return statement in function returning non-void [-Wreturn-type]
   34 | }
      | ^
a.cc: At global scope:
a.cc:36:22: error: '_TCHAR' has not been declared
   36 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

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

using namespace std;
list<int> lst;

int main()
{
	int dataset; scanf_s("%d", &dataset);
	for (int i = 0; i < dataset; i++)
	{
		string order;
		cin >> order;
		if (order[0] == 'i') {
			int a; scanf("%d", &a);
			lst.push_front(a);
		}
		else if (order[6] == 'F') {
			lst.pop_front();
		}
		else if (order[6] == 'L') {
			lst.pop_back();
		}
		else {
			int order; cin >> order;
			auto itr = lst.begin();
			int size = lst.size();
			for (int i = 0; i < size; i++)
			{
				if (*itr == order) {
					lst.erase(itr);
					break;
				}
				itr++;
			}
		}
	}
	for (
		auto itr = lst.begin(); itr != lst.end(); itr++)
	{
		if (itr != lst.begin()) {
			printf(" ");
		}
		printf("%d", *itr);
	}
	printf("\n");
	return 0;
}

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

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string,h>

using namespace std;
struct Node{
	int key;
	Node *prev, *next;
};

Node *nil;

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

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;
}

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

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);)
}

int main(){
	int n, key;
	char com[20];
	scanf("%d", &n);
	init();
	for (int i = 0; i < n; i++){
		scanf("%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{
				delete(key);
			}
		}
	}
	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");
}

Compiler output:
a.cc:5:9: fatal error: string,h: No such file or directory
    5 | #include<string,h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

using namespace std;
struct Node{
	int key;
	Node *prev, *next;
};

Node *nil;

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

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;
}

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

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);)
}

int main(){
	int n, key;
	char com[20];
	scanf("%d", &n);
	init();
	for (int i = 0; i < n; i++){
		scanf("%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{
				delete(key);
			}
		}
	}
	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");
}

Compiler output:
a.cc: In function 'void deleteKey(int)':
a.cc:54:35: error: expected ')' before ';' token
   54 |         deleteNode(listSearch(key);)
      |                   ~               ^
      |                                   )
a.cc:54:36: error: expected primary-expression before ')' token
   54 |         deleteNode(listSearch(key);)
      |                                    ^
a.cc: In function 'int main()':
a.cc:73:40: error: type 'int' argument given to 'delete', expected pointer
   73 |                                 delete(key);
      |                                       ~^~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string,h>

using namespace std;
struct Node{
	int key;
	Node *prev, *next;
};

Node *nil;

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

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;
}

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

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));
}

int main(){
	int n, key;
	char com[20];
	scanf("%d", &n);
	init();
	for (int i = 0; i < n; i++){
		scanf("%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{
				delete(key);
			}
		}
	}
	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");
}

Compiler output:
a.cc:5:9: fatal error: string,h: No such file or directory
    5 | #include<string,h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

using namespace std;
struct Node{
	int key;
	Node *prev, *next;
};

Node *nil;

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

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;
}

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

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));
}

int main(){
	int n, key;
	char com[20];
	scanf("%d", &n);
	init();
	for (int i = 0; i < n; i++){
		scanf("%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{
				delete(key);
			}
		}
	}
	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");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:40: error: type 'int' argument given to 'delete', expected pointer
   73 |                                 delete(key);
      |                                       ~^~~~
Language: C++

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

class LIST
{
public:
	LIST(){};
	~LIST() {};
	void Insert(int val);
	LIST* Search(int val);
	void Delete(LIST* l);
	void DeleteFirst();
	void DeleteLast();
	void DeleteValue(int val);
	void Show()const;

	long int value;
	LIST* next = NULL;
	LIST* previous = NULL;

};


int main()
{
	LIST *L=new LIST();
	L->next = L;
	L->previous = L;

	int n;
	scanf_s("%d", &n);
	for (int i = 0; i < n; i++)
	{
		char str[15];
		int N;
		scanf_s("%s", str,15);
		if (str[6] != 'F'&&str[6] != 'L')scanf_s("%d",&N);
		if (str[0] == 'i')
		{
			L->Insert(N);
		}

		else if (str[6] == 'F')
		{
			L->DeleteFirst();
		}
		else if (str[6] == 'L')
		{
			L->DeleteLast();
		}
		else if (str[0] == 'd')
		{
			L->DeleteValue(N);
		}
	}

	L->Show();
	

	return 0;
}

void LIST::Insert(int val)
{
	LIST *l = new LIST();
	l->value = val;
	l->next = next;
	next->previous = l;
	next = l;
	l->previous = this;
}

LIST* LIST::Search(int val)
{
	LIST *l = next;
	while (l != this&&l->value != val)
	{
		l = l->next;
	}
	return l;
}

void LIST::Delete(LIST* l)
{
	if (l != this)
	{
		l->previous->next = l->next;
		l->next->previous = l->previous;
		delete l;
	}
}

void  LIST::DeleteFirst()
{
	Delete(next);
}
void LIST::DeleteLast()
{
	Delete(previous);
}

void LIST::DeleteValue(int val)
{
	Delete(Search(val));
}

void LIST::Show()const
{
	LIST* l = next;
	while (l->next!=next)
	{
		cout << l->value;
		l = l->next;
		if (l->next != next)
		{
			cout << " ";
		}
	}
	cout << endl;
}

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

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

class LIST
{
public:
	LIST(){};
	~LIST() {};
	void Insert(int val);
	LIST* Search(int val);
	void Delete(LIST* l);
	void DeleteFirst();
	void DeleteLast();
	void DeleteValue(int val);
	void Show()const;

	long int value;
	LIST* next = NULL;
	LIST* previous = NULL;

};


int main()
{
	LIST *L=new LIST();
	L->next = L;
	L->previous = L;

	int n;
	scanf_s("%d", &n);
	for (int i = 0; i < n; i++)
	{
		char str[15];
		int N;
		scanf_s("%s", str,15);
		if (str[6] != 'F'&&str[6] != 'L')scanf_s("%d",&N);
		if (str[0] == 'i')
		{
			L->Insert(N);
		}

		else if (str[6] == 'F')
		{
			L->DeleteFirst();
		}
		else if (str[6] == 'L')
		{
			L->DeleteLast();
		}
		else if (str[0] == 'd')
		{
			L->DeleteValue(N);
		}
	}

	L->Show();
	

	return 0;
}

void LIST::Insert(int val)
{
	LIST *l = new LIST();
	l->value = val;
	l->next = next;
	next->previous = l;
	next = l;
	l->previous = this;
}

LIST* LIST::Search(int val)
{
	LIST *l = next;
	while (l != this&&l->value != val)
	{
		l = l->next;
	}
	return l;
}

void LIST::Delete(LIST* l)
{
	if (l != this)
	{
		l->previous->next = l->next;
		l->next->previous = l->previous;
		delete l;
	}
}

void  LIST::DeleteFirst()
{
	Delete(next);
}
void LIST::DeleteLast()
{
	Delete(previous);
}

void LIST::DeleteValue(int val)
{
	Delete(Search(val));
}

void LIST::Show()const
{
	LIST* l = next;
	while (l->next!=next)
	{
		cout << l->value;
		l = l->next;
		if (l->next != next)
		{
			cout << " ";
		}
	}
	cout << endl;
}

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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <string>
using namespace std;

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

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) {
    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->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 {
                deleteKey(key);
                nd++;
            }
            size--;
        }
    }
    
    printList();
    
    return 0;
}

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

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

class Node{
	int data;
	Node* prev;
	Node* next;
	public:
	Node(){
		data = 0;
	}
	Node(int x, Node* p, Node* n){
		data = x;
		prev = p;
		next = n;
	}
	
	void SetPrev(Node* p){
		prev = p;
	}
	
	void SetNext(Node* n){
		next = n;
	}
	
	Node* GetPrev(){
		return prev;
	}
	
	Node* GetNext(){
		return next;
	}
	
	int GetData(){
		return data;
	}
};

class LinkedList{
	Node* head;
	Node* tail;
	public:
	LinkedList(){
		head = new Node();
		tail = new Node();
		head->SetNext(tail);
		tail->SetPrev(head);
	}
	
	void Insert(int x){
		Node* node = new Node(x, head, head->GetNext());
		node->GetNext()->SetPrev(node);
		node->GetPrev()->SetNext(node);
	}
	
	void Delete(int x){
		Node* current = head->GetNext();
		while(current != tail){
			if(current->GetData() == x){
				current->GetNext()->SetPrev(current->GetPrev());
				current->GetPrev()->SetNext(current->GetNext());
				delete current;
				return;
			}
			current = current->GetNext();
		}
	}
	
	void DeleteFirst(){
		Node* node = head->GetNext();
		node->GetNext()->SetPrev(head);
		head->SetNext(node->GetNext());
		delete node;
	}
	
	void DeleteLast(){
		Node* node = tail->GetPrev();
		tail->SetPrev(node->GetPrev());
		node->GetPrev()->SetNext(tail);
		delete node;
	}
	
	Node* GetHead(){
		return head;
	}

Compiler output:
a.cc:86:10: error: expected '}' at end of input
   86 |         }
      |          ^
a.cc:40:17: note: to match this '{'
   40 | class LinkedList{
      |                 ^
a.cc:86:10: error: expected unqualified-id at end of input
   86 |         }
      |          ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template<typename T>
struct List {
	template<typename T>
	struct Node {
		T key;
		Node *next, *prev;
		Node() {}
	};
	Node<T> *p;
	List() {
		p = (Node<T>*)malloc(sizeof(Node<T>));
		p->next = p->prev = p;
	}
	void insert(T x) {
		Node<T> *a = (Node<T>*)malloc(sizeof(Node<T>));
		a->key = x;
		a->next = p->next;
		p->next->prev = a;
		a->prev = p;
		p->next = a;
	}
	Node<T>* findkey(T x) {
		Node<T> *c;
		for (c = p->next; c->key != x&&c != p; c = c->next);
		return c;
	}
	void deletepointer(Node<T> *d) {
		if (d == p)return;
		d->prev->next = d->next;
		d->next->prev = d->prev;
		free(d);
	}
	void deletekey(T x) {
		deletepointer(findkey(x));
	}
	void deleteFirst() {
		deletepointer(p->next);
	}
	void deleteLast() {
		deletepointer(p->prev);
	}
	void print() {
		for (Node<T> *a = p->next; a != p; a = a->next) {
			cout << a->key << (a == p->prev ? '\n' : ' ');
		}
	}
};
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	List<int> ls;
	int N; cin >> N;
	rep(i, 0, N) {
		string s; cin >> s;
		if (s[0] == 'i') {
			int x; cin >> x;
			ls.insert(x);
		}
		else if (s == "deleteFirst")ls.deleteFirst();
		else if (s == "deleteLast")ls.deleteLast();
		else {
			int x; cin >> x;
			ls.deletekey(x);
		}

	}
	ls.print();
	return 0;
}

Compiler output:
a.cc:21:18: error: declaration of template parameter 'T' shadows template parameter
   21 |         template<typename T>
      |                  ^~~~~~~~
a.cc:19:10: note: template parameter 'T' declared here
   19 | template<typename T>
      |          ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;

class Node{
public:
	Node* prev;
	Node*next;
	int data;
	Node(){
		prev=0;
		next=0;
		data=0;
	}
}
	
class List{
private:
	Node head;
public:
	List(){
		head.prev=&head;
		head.next=&head;
	}
	int insert(int x);
	int del(int x);
	int deleteFirst();
	int deleteLast();
	void print();
};

int List::insert(int x){
	Node*p=new Node();

	if(p==0)
		return -1;

	Node*q=&head;
	Node*r=nead.next;
	
	p->prev=q;
	p->next=r;
	p->data=x;

	q->next=p;
	r->prev=p;
	
	return 0;
}

int List:del(int x){
	Node*p;
	for(p=head.next;p!=&head;p=p->next){
		if(p->data=x)
			break;
	}

	i(p==&head)
		return -2;

	Node*q=p->prev;
	Node*r=p->next;

	q->next=r;	
	r->prev=q;

	delete p;
	
	return 0;
}

int List::deleteFirst(){
	Node* p=head.next;
	
	if(p==&head)
		return -2;
	
	Node*q=p->prev;
	Node*r=p->next;

	q->next=r;	
	r->prev=q;		

	delete p;
	
	return 0;
}

int List::deleteLast(){
	Node* p=head.prev;
	
	if(p==&head)
		return -2;
	
	Node*q=p->prev;
	Node*r=p->next;

	q->next=r;	
	r->prev=q;		

	delete p;
	
	return 0;	
}

void List::print(){
	for(p=head.next;p!=&head;p=p->next){
		cout<<p->data;
		if(p->next!=&head){
			cout<<' ';
		}
		else{
			cout<<endl;
		}
	}
}

int main(){
	List L;

	int n;
	cin>>n;
	
q	for(int i=0;i<n;i++){
		char com[20];
		cin>>com;
	
		if(com[0=='i'){
			int x;
			cin>>x;
		
			L.insert(x);
		}
		else if(com[6]=='F'){
			L.deleteFirst();
		}
		else if(com[6]=='L'){
			L.deleteLast();
		}
		else{
			int x;
			cin>>x;
	
			L.del(x);
		}
	}

	L.print();

	return 0;
}

Compiler output:
a.cc:14:2: error: expected ';' after class definition
   14 | }
      |  ^
      |  ;
a.cc: In member function 'int List::insert(int)':
a.cc:38:16: error: 'nead' was not declared in this scope; did you mean 'head'?
   38 |         Node*r=nead.next;
      |                ^~~~
      |                head
a.cc: At global scope:
a.cc:50:9: error: found ':' in nested-name-specifier, expected '::'
   50 | int List:del(int x){
      |         ^
      |         ::
a.cc: In member function 'int List::del(int)':
a.cc:57:9: error: 'i' was not declared in this scope
   57 |         i(p==&head)
      |         ^
a.cc: In member function 'void List::print()':
a.cc:106:13: error: 'p' was not declared in this scope
  106 |         for(p=head.next;p!=&head;p=p->next){
      |             ^
a.cc: In function 'int main()':
a.cc:123:1: error: 'q' was not declared in this scope
  123 | q       for(int i=0;i<n;i++){
      | ^
a.cc:123:21: error: 'i' was not declared in this scope
  123 | q       for(int i=0;i<n;i++){
      |                     ^
Language: C++

#include<iostream>
using namespace std;

//NODE?????????
class Node{
	public:
 Node* prev;
 Node* next;
 int data;
 Node(){prev=0;next=0;data=0;}
};

//List?????????
class List{
	private:
 Node head;
	public:
 List(){head.prev=&head.next=&head;}
 int insert(int x);
 int del(int x);
 int deleteFirst();
 int deleteLast();
 void print();
};

//insert????????????
int List::insert(int x){
 Node* p= nwe Node();

 if(p==0)
	return -1;

 Node* q=&head;
 Node* r=head.next;

 p->prev=q;
 p->next=r;
 p->data=x;

 q->next=p;
 r->prev=p;

 return 0;
}

//del
int List::del(int x){
 Node* p;
 for (p=head.next;p!=&head;p=p->next){
	if(p->data==)
		break;
 }
 if(p==&head)
	return -2;

 Node* q=p->prev;
 Node* r=p->next;

 q->next=r;
 r->prev=q;

 delete p;

 return 0;
}

//deleteFirst
int List::deleteFirst(){
 Node*p=head.next;

 if(p==&head)
	return -2;

 Node*q=p->prev;
 Node*r=p->next;

 delete p;

return 0;
}

//deleteLast
int List::deleteLast(){
 Node* p=head.prev;

 if(p==&head)
	return -2;

 Node* q=p->prev;
 Node* r=p->next;

 q->next=r;
 r->prev=q;

 delete p;

return 0;
}

//print
void List::print(){
 for(Node* p=head.next;p!=&head;p=p->next){
	cout<<p->data;
	if(p->next!=&head){
		cout<<' ';
	}else{
		cout<<endl;
	}
 }
}

//main
int main(){
 List L;

 int n;
 cin>>n;

 for(int i=0;i<n;i++){
	char com[20];
	cin>>com;

	if(com[0]=='i'){
		int x;
		cin>>x;
		L.insert(x);
	}
	else if(com[6]=='F'){
		L.deleteFirst();
	}
	else if(com[6]=='L'){
		L.deleteLast();
	}
	else {
		int x;
		cin>>x;
		L.del(x);
	}
 }
 L.print();
 return 0;
}

Compiler output:
a.cc: In constructor 'List::List()':
a.cc:18:19: error: lvalue required as left operand of assignment
   18 |  List(){head.prev=&head.next=&head;}
      |                   ^~~~~~~~~~
a.cc: In member function 'int List::insert(int)':
a.cc:28:11: error: 'nwe' was not declared in this scope
   28 |  Node* p= nwe Node();
      |           ^~~
a.cc: In member function 'int List::del(int)':
a.cc:50:21: error: expected primary-expression before ')' token
   50 |         if(p->data==)
      |                     ^
Language: C++

#include"stdafx.h"
#include<cstdio>
#include<cstdlib>
#include<cstring>

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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 {
			deleteKey(key); nd++;
		}
		size--;
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include"stdafx.h"
#include<cstdio>
#include<cstdlib>
#include<cstring>

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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_s("%d", &n);
	init();
	for (i = 0; i < n; i++) {
		scanf_s("%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 {
			deleteKey(key); nd++;
		}
		size--;
                }
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include"stdafx.h"
#include<cstdio>
#include<cstdlib>
#include<cstring>

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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 {
			deleteKey(key); nd++;
		}
		size--;
                }
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include"stdafx.h"
#include<cstdio>
#include<cstdlib>
#include<cstring>

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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 {
			deleteKey(key); nd++;
		}
		size--;
            }
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++


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

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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_s("%d", &n);
	init();
	for (i = 0; i < n; i++) {
		scanf_s("%s%d", com,20,  &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);
			}
			size--;
		}
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:2:9: fatal error: stdafx.h: No such file or directory
    2 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++


#include"stdafx.h"
#include<cstdio.h>
#include<cstdlib.h>
#include<cstring.h>

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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 {
				deleteKey(key);
			}
			size--;
		}
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:2:9: fatal error: stdafx.h: No such file or directory
    2 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

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

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 (1) {
		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 ??????????????´?????????????????????
	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->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 {
				deleteKey(key);
			}
			size--;
		}
	}

	PrintList();

	return 0;
}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

class Node{
public:
	Node* prev;
	Node*next;
	int data;
	Node(){prev=0;next=0;date=0;}
};

class List{
private:
	Node head;
public:
	List(){head.prev=&head;head.next=&head;}
	int insert(int x);
	int del(int x);
	int deleteFirst();
	int deleteLast();
	void print();
};

int List::insert(int x)
{
	Node* p=new Node();

	if(p==0)
		return -1;
	Node* q=&head;
	Node* r=head.next;

	p->prev=q;
	p->next=r;
	p->data=x;

	q->next=p;
	r->prev=p;
	return 0;
}

int List::del(int x)
{
	Node* p;

	for(p=head.next;p!=&head; p=p->next){
		if(p->data==x)
			break;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;
}

int List::deleteFirst()
{
	Node* p=head.next;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;


}

int List::deleteLast()
{
	Node* p=head.prev;

	if(p==&head)
		return -2;
	Node* q=p->prev;
	Node* r=p->next;


	q->next=r;
	r->prev=q;

	delete p;
	return 0;
}

void List::print()
{
	for(Node* p=head.next;p!=&head; p=p->next){
		cout<<p->data;

		if(p->next!=&head){
			cout<<' ';
		}else{
			cout<<endl;
		}
	}
}

}

int main()
{
	List L;
	int n;
	cin>>n;

	for (int i = 0; i < n; i++) {
		char com[20];
		cin >> com;

		if (com[0] == 'i') {
			int x;
			cin >> x;
			L.insert(x);
		}
		else if (com[6] == 'F') {
			L.deleteFirst();
		}
		else if (com[6] == 'L') {
			L.deleteLast();
		}
		else {
			int x;
			cin >> x;
			L.del(x);
		}
	}

}

Compiler output:
a.cc: In constructor 'Node::Node()':
a.cc:9:30: error: 'date' was not declared in this scope; did you mean 'data'?
    9 |         Node(){prev=0;next=0;date=0;}
      |                              ^~~~
      |                              data
a.cc: In member function 'int List::del(int)':
a.cc:63:22: error: qualified-id in declaration before '(' token
   63 | int List::deleteFirst()
      |                      ^
a.cc:82:21: error: qualified-id in declaration before '(' token
   82 | int List::deleteLast()
      |                     ^
a.cc:99:17: error: qualified-id in declaration before '(' token
   99 | void List::print()
      |                 ^
a.cc:112:1: warning: control reaches end of non-void function [-Wreturn-type]
  112 | }
      | ^