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

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

typedef struct {
	string s;
	int t;
}Unit;

int main(void)
{
	int n, m;
	cin >> n;
	list<int> L;
	char s[20];
	for (int i = 0; i < n; i++) {
		scanf("%s %d", s, &m);
		if (s[0] == 'i') {
			L.push_front(m);
		}
		else if (strlen(s) == 6) {
			for (list<int>::iterator it=L.begin(); it != L.end(); it++) {
				if (*it == m) {
					L.erase(it);
					break;
				}
			}
		}
		else if (strlen(s) == 11) {
			L.pop_front();
		}
		else {
			L.pop_back();
		}
	}
	int i = 0;
	for (list<int>::iterator it = L.begin(); it != L.end(); it++) {
		if (i++)
			cout << " ";
		cout << *it;
	}
	cout << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: 'strlen' was not declared in this scope
   29 |                 else if (strlen(s) == 6) {
      |                          ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include<cstdio>
  +++ |+#include <cstring>
   10 | //#include<cmath>
Language: C++

#include <cstdio>
#include <list>
#include <algorithm>
using namespace std;
typedef long long ll;

int main()
{
  int n, i, a;
  char s[20];
  list<int> v;

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", s);
    if (s[0] == 'i') {
      scanf("%d", &a);
      v.push_front(a);
    }
    else if (s[6] == 'F')
      v.pop_front();
    else if (s[6] == 'L')
      v.pop_back();
    else {
      scanf("%d", &a);
      for (list<int>::iterator it = v.begin(); it != v.end(); it++) {
	if (*it == a) {
	  v.erase(it);
	  break;
	}
      }
    }
  }
  i = 0;
  for (list<int>::iterator it = v.begin(); it != v.end(); it++) {
    if (i++)
        pritnf(" ");
    printf("%d", *it);
  }
  putchar('\n');
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   37 |         pritnf(" ");
      |         ^~~~~~
      |         printf
Language: C++

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

int main(){
    int q,x;
    char com[20];
    list<int>v;
    scanf("%d",&q);
    for(int i=0;i<q;i++){
        scanf("%s",com);
        if(com[0]=='i'){
            scanf("%s",&x);
            v.push_front(x);
        }else if(com[6]=='L'){
            v.pop_back();
        }else if(com[6]=='F'){
            v.pop_front();
        }else if(com[0]=='d'){
            scanf("%d",&x);
            for(list<int>::iterator it=v.begin();it !=v.end();it++){
                if(*it==x){
                    v.erasse(it);
                    break;
                }
            }
        }
    }
    int i=0;
    for(liat<int>::iterator it=v.begin();it!=v.end();it++){
        if(i++)printf(" ");
        printf("%d",*it);
    }
    printf("\n");
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: 'class std::__cxx11::list<int>' has no member named 'erasse'; did you mean 'erase'?
   24 |                     v.erasse(it);
      |                       ^~~~~~
      |                       erase
a.cc:31:9: error: 'liat' was not declared in this scope
   31 |     for(liat<int>::iterator it=v.begin();it!=v.end();it++){
      |         ^~~~
a.cc:31:14: error: expected primary-expression before 'int'
   31 |     for(liat<int>::iterator it=v.begin();it!=v.end();it++){
      |              ^~~
a.cc:31:42: error: 'it' was not declared in this scope; did you mean 'i'?
   31 |     for(liat<int>::iterator it=v.begin();it!=v.end();it++){
      |                                          ^~
      |                                          i
Language: C++

#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->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:75:53: error: expected ';' before '}' token
   75 |       if(com[0] == 'i' ) { insert(key); np++; size++}
      |                                                     ^
      |                                                     ;
Language: C++

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

void delete(int key[2000000],int j,int k){
  int i;
  for(i=j;i<k;i++){
    key[i]=key[i+1];
  }
}
int main(void){
  int n,i,j,k,x,key[2000000];
  char com[20];
  k=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%s",com);
    if(strcmp(com,"insert")==0){
      scanf("%d",&x);
      k++;
      key[k]=x;
    }
    else if(strcmp(com,"delete")==0){
      scanf("%d",&x);
      for(j=1;j<=k;j++){
	if(key[j]==x){
	  delete(key,j,k);
	  k--;
	  break;
	}
      }
    }
    else if(strcmp(com,"deleteFirst")==0){
      key[k]=0;
      k--;
    }
    else if(strcmp(com,"deleteLast")==0){
      delete(key,1,k);
      k--;
    }
  }
  for(i=k;i>=1;i--){
    printf("%d",key[i]);
    if(i>1) printf(" ");
  }
  printf("\n");
  return 0;
}



Compiler output:
a.cc:4:6: error: expected unqualified-id before 'delete'
    4 | void delete(int key[2000000],int j,int k){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:26:23: error: type 'int' argument given to 'delete', expected pointer
   26 |           delete(key,j,k);
      |                 ~~~~~~^~~
a.cc:37:19: error: type 'int' argument given to 'delete', expected pointer
   37 |       delete(key,1,k);
      |             ~~~~~~^~~
Language: C++

#include <stdio.h>
#include <string.h>
int s;
void delete(int key[2000000],int j){
  key[j]=-1;
}
int main(void){
  int n,i,j,k,x,key[2000000];
  char com[20];
  k=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%s",com);
    if(strcmp(com,"insert")==0){
      scanf("%d",&x);
      k++;
      key[k]=x;
    }
    else if(strcmp(com,"delete")==0){
      scanf("%d",&x);
      for(j=k;j>=1;j--){
	if(key[j]==x){
	  delete(key,j);
	  break;
	}
      }
    }
    else if(strcmp(com,"deleteFirst")==0){
      for(j=k;j>=1;j--){
	if(key[j]!=-1){
	  delete(key,j);
	  break;
	}
      }
    }
    else if(strcmp(com,"deleteLast")==0){
      for(j=1;j<=k;j++){
	if(key[j]!=-1){
	  delete(key,j);
	  break;
	}
      }
    }
  }
  for(i=k;i>=1;i--){
    if(key[i]!=-1) s=i;
  }
  for(i=k;i>=s;i--){
    if(key[i]!=-1){
      printf("%d",key[i]);
      if(i>s) printf(" ");
    }
  }
  printf("\n");
  return 0;
}



Compiler output:
a.cc:4:6: error: expected unqualified-id before 'delete'
    4 | void delete(int key[2000000],int j){
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:23:21: error: type 'int' argument given to 'delete', expected pointer
   23 |           delete(key,j);
      |                 ~~~~^~~
a.cc:31:21: error: type 'int' argument given to 'delete', expected pointer
   31 |           delete(key,j);
      |                 ~~~~^~~
a.cc:39:21: error: type 'int' argument given to 'delete', expected pointer
   39 |           delete(key,j);
      |                 ~~~~^~~
Language: C++

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


using namespace std;



int main() {


	list<int> lnk;

	const int SLEN = 20;
	char com[SLEN];
	int n, key = 0;


	scanf("%d", &n);

	for (int i = 0;i < n;i++)
	{
		scanf("%s%d", com, &key);

		if (com[0] == 'i') {
			　lnk.push_front(key);
		}
		else if (com[0] == 'd') {

			if (strlen(com) > 6) {
				if (com[6] == 'F') {
					lnk.pop_front();
				}
				else if (com[6] == 'L') {
					lnk.pop_back();
				}
			}
			else {
				for (list<int>::iterator it = lnk.begin();it != lnk.end();it++) {
					if (*it == key) {
						lnk.erase(it);
						break;
					}
				}
			}
		}
	}

	int i = 0;
	for (list<int>::iterator it = lnk.begin();it != lnk.end();it++) {
		if (i++) printf(" ");
		printf("%d", *it);
	}
	printf("\n");

	return 0;
}



Compiler output:
a.cc:28:25: error: extended character 　 is not valid in an identifier
   28 |                         　lnk.push_front(key);
      |                         ^
a.cc: In function 'int main()':
a.cc:28:25: error: '\U00003000lnk' was not declared in this scope
   28 |                         　lnk.push_front(key);
      |                         ^~~~~
a.cc:32:29: error: 'strlen' was not declared in this scope
   32 |                         if (strlen(com) > 6) {
      |                             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <list>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <list>
#include <cstring>


using namespace std;



int main() {


	list<int> lnk;

	const int SLEN = 20;
	char com[SLEN];
	int n, key = 0;


	scanf("%d", &n);

	for (int i = 0;i < n;i++)
	{
		scanf("%s%d", com, &key);

		if (com[0] == 'i') {
			　lnk.push_front(key);
		}
		else if (com[0] == 'd') {

			if (strlen(com) > 6) {
				if (com[6] == 'F') {
					lnk.pop_front();
				}
				else if (com[6] == 'L') {
					lnk.pop_back();
				}
			}
			else {
				for (list<int>::iterator it = lnk.begin();it != lnk.end();it++) {
					if (*it == key) {
						lnk.erase(it);
						break;
					}
				}
			}
		}
	}

	int i = 0;
	for (list<int>::iterator it = lnk.begin();it != lnk.end();it++) {
		if (i++) printf(" ");
		printf("%d", *it);
	}
	printf("\n");

	return 0;
}



Compiler output:
a.cc:28:25: error: extended character 　 is not valid in an identifier
   28 |                         　lnk.push_front(key);
      |                         ^
a.cc: In function 'int main()':
a.cc:28:25: error: '\U00003000lnk' was not declared in this scope
   28 |                         　lnk.push_front(key);
      |                         ^~~~~
Language: C++

#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
#include<list>
#include<algorithm>
using namespace std;

int main(int argc,char* argv[]){
  int n,key;
  list<int> li;

  cin>>n;

  
  while(n-->0){
    string str;
    cin>>str;
    
    if(str=="insert"){
      cin>>key;
      li.push_front(key);
    }
    else if(str=="delete"){
      cin>>key;
      list<int>::iterator itli;
      itli=find(li.begin(),li.end(),key);
      if(itli!=li.end()){
      li.erase(itli);
      }
    }
    else if(str=="deleteFirst")
      li.pop_front();
    else
      li.pop_back();
  }

  if(!li.empty()){
    cout<<li.front();li.pop_front();
    while(!li.empty()){
      cout<<" "<<li.front();li.pop_front();
    }
    puts("");
  }
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:13:3: error: 'cin' was not declared in this scope
   13 |   cin>>n;
      |   ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include<algorithm>
  +++ |+#include <iostream>
    7 | using namespace std;
a.cc:39:5: error: 'cout' was not declared in this scope
   39 |     cout<<li.front();li.pop_front();
      |     ^~~~
a.cc:39:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

using namespace std;
#define _CRT_SECURE_NO_WARNINGS
int main()
{
	int n;
	cin >> n;
	vector<int> a;
	vector<int>::iterator aho;
	for (int i = 0; i < n; i++)
	{
		string mission; int x;
		cin >> mission;
		if (mission == "insert" || mission == "delete")cin >> x;
		if (mission=="insert")
		{
			a.insert(a.begin(), x);
		}
		else if (mission == "delete")
		{
			for (int s = 0; s < a.size(); s++)
			{
				if (a[s] == x)
				{
					a.erase(a.begin() + s); break;
				}
			}
		}
		else if (mission == "deleteFirst")
		{
			reverse(a.begin(), a.end());
			a.pop_back();
			reverse(a.begin(), a.end());
		}
		else if (mission == "deleteLast")
		{
			a.pop_back();
		}
	}
	for (int 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:36:25: error: 'reverse' was not declared in this scope
   36 |                         reverse(a.begin(), a.end());
      |                         ^~~~~~~
Language: C++

// ConsoleApplication2.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <deque>

using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	deque <int> d;
	int n;
	string cmd;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> cmd;
		if (cmd == "insert"){
			int x;
			cin >> x;
			d.push_front(x);
		}
		else if (cmd == "delete"){
			int x;
			cin >> x;
			for (deque<int>::iterator i = d.begin(); i != d.end(); i++){
				if (*i == x){
					d.erase(i);
					break;
				}
			}
		}
		else if (cmd == "deleteFirst"){
			d.pop_front();
		}
		else{
			d.pop_back();
		}
	}
	for (deque<int>::iterator i = d.begin(); i != d.end() - 1; i++){
		cout << *i << " ";
	}
	cout << d.back() << endl;

return 0;
}

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

#include <iostream>
#include <cstdio>
#include <string>
#include <deque>

using namespace std;

#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)

deque<int> lst;
int main() {
	int n, v;
	string s;
	cin >> n;
	rep(i,n) {
		cin >> s;
		if(s == "insert") {
			cin >> v;
			lst.push_front(v);
		} else if(s == "delete") {
			cin >> v;
			auto it = find(lst.begin(), lst.end(), v);
			if(it != lst.end()) lst.erase(it);
		} else if(s == "deleteFirst") {
			lst.pop_front();
		} else if(s == "deleteLast") {
			lst.pop_back();
		}
	}
	for(auto it = lst.begin(); it != --lst.end(); ++it) {
		cout << *it << " ";
	}
	cout << *--lst.end() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:39: error: no matching function for call to 'find(std::deque<int>::iterator, std::deque<int>::iterator, int&)'
   23 |                         auto it = find(lst.begin(), lst.end(), v);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:23:39: note:   'std::_Deque_iterator<int, int&, int*>' is not derived from 'std::istreambuf_iterator<_CharT>'
   23 |                         auto it = find(lst.begin(), lst.end(), v);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include "stdafx.h"
#include "iostream"
#include "string"
#include <stack>
#include <queue>
#include <sstream>
using namespace std;

void A()
{
	stack<int> stack;
	string str;
	while (cin >> str)
	{
		if (str == "+" || str == "-" || str == "*")
		{
			int b = stack.top();
			stack.pop();
			int a = stack.top();
			stack.pop();
			int c;
			if (str == "+")
			{
				c = a + b;
			}
			else if (str == "-")
			{
				c = a - b;
			}
			else
			{
				c = a * b;
			}

			stack.push(c);
		}
		else
		{
			int num = stoi(str);
			stack.push(num);
		}
	}

	cout << stack.top() << endl;
}

void B()
{
	queue<string> name;
	queue<int> time;
	int spendTime = 0;
	int N;
	int Q;
	cin >> N;
	cin >> Q;

	cin.ignore();
	string line;
	string s;
	for (int i = 0; i < N;i++)
	{
		getline(cin, line);
		stringstream ss(line);
		ss >> s;
		name.push(s);
		ss >> s;
		time.push(stoi(s));
	}

	while (!time.empty())
	{
		int left = time.front();
		time.pop();
		string n = name.front();
		name.pop();

		if (Q >= left)
		{
			spendTime += left;
			cout << n << " " << spendTime<<endl;
		}
		else
		{
			spendTime += Q;
			time.push(left - Q);
			name.push(n);
		}
	}

	/*while (!name.empty())
	{
		cout << name.front() << endl;
		name.pop();
		cout << time.front() << endl;
		time.pop();
	}*/
}

struct Cell
{
	int data;
	Cell *prev;
	Cell *next;
};

Cell *start;
void insert(int x)
{
	Cell *c = (Cell *)malloc(sizeof(Cell));
	c->data = x;
	c->prev = start;
	c->next = start->next;
	start->next->prev = c;
	start->next = c;
}
void delete_x(int x)
{
	Cell *c = start->next;
	while (c != start && c->data != x)
	{
		c = c->next;
	}

	if (c == start)return;

	c->prev->next = c->next;
	c->next->prev = c->prev;
	free(c);
}

void deleteFirst()
{
	Cell *c = start->next;
	if (c == start)return;

	c->prev->next = c->next;
	c->next->prev = c->prev;
	free(c);
}

void deleteLast()
{
	Cell *c = start->prev;
	if (c == start)return;

	c->prev->next = start;
	start->prev = c->prev;
	free(c);
}

void print()
{
	Cell *c = start->next;
	int i = 0;
	while (true)
	{
		if (c == start)break;
		if (i != 0)cout << " " << flush;
		cout << c->data << flush;
		i++;
		c = c->next;
	}

	cout << endl;
}

void C()
{
	int N;
	string command;
	int x;
	cin >> N;

	start = (Cell *)malloc(sizeof(Cell));
	start->next = start;
	start->prev = start;

	for (int i = 0; i < N;i++)
	{
		cin >> command;
		string first;
		first = command.substr(0,1);

		if (first == "i")
		{
			cin >> x;
			insert(x);
			//cout << "insert" << endl;
		}
		else if (command.length() > 6)
		{
			string seventh;
			seventh = command.substr(6, 1);

			if (seventh == "F")
			{
				//cout << "First" << endl;
				deleteFirst();

			}
			else if (seventh == "L")
			{
				//cout << "Last" << endl;
				deleteLast();
			}

		}
		else if (first == "d")
		{
			cin >> x;
			//cout << "delete" << endl;
			delete_x(x);
		}

		//print();
	}

	print();
}

void D()
{

}
int main()
{
	//A();
	//B();
	C();
	return 0;
}

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

#include <iostream>
#include <iomanip>
#include <math.h>
#include <fstream>
#include <string>
#include <time.h>
#include <ctime>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cstdlib>
using namespace std;

struct Node{
	int key;
    Node* prev;
	Node* 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));
}

void print(){
	Node* cur = nil->next;
	while(cur != nil){
		if(cur != nil->next)printf(" "); 
		printf("%d",cur->key);
		cur = cur->next;
	}
	printf("\n");
}

int main(){

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

	print();

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:87:16: error: expected unqualified-id before '=' token
   87 |         for(int=0;i<n;i++){
      |                ^
a.cc:87:16: error: expected ';' before '=' token
   87 |         for(int=0;i<n;i++){
      |                ^
      |                ;
a.cc:87:16: error: expected primary-expression before '=' token
a.cc:87:22: error: expected ')' before ';' token
   87 |         for(int=0;i<n;i++){
      |            ~         ^
      |                      )
a.cc:87:26: error: expected ';' before ')' token
   87 |         for(int=0;i<n;i++){
      |                          ^
      |                          ;
a.cc:104:2: error: expected '}' at end of input
  104 | }
      |  ^
a.cc:79:11: note: to match this '{'
   79 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <iomanip>
#include <math.h>
#include <fstream>
#include <string>
#include <time.h>
#include <ctime>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cstdlib>
using namespace std;

struct Node{
	int key;
    Node* prev;
	Node* 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));
}

void print(){
	Node* cur = nil->next;
	while(cur != nil){
		if(cur != nil->next)printf(" "); 
		printf("%d",cur->key);
		cur = cur->next;
	}
	printf("\n");
}

int main(){

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

	print();

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:28: error: 'strlen' was not declared in this scope
   91 |                         if(strlen(com)>6){
      |                            ^~~~~~
a.cc:17:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   16 | #include <cstdlib>
  +++ |+#include <cstring>
   17 | using namespace std;
a.cc:104:2: error: expected '}' at end of input
  104 | }
      |  ^
a.cc:79:11: note: to match this '{'
   79 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <iomanip>
#include <math.h>
#include <fstream>
#include <string>
#include <time.h>
#include <ctime>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cstdlib>
using namespace std;

struct Node{
	int key;
    Node* prev;
	Node* 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));
}

void print(){
	Node* cur = nil->next;
	while(cur != nil){
		if(cur != nil->next)printf(" "); 
		printf("%d",cur->key);
		cur = cur->next;
	}
	printf("\n");
}

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

	print();

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:28: error: 'strlen' was not declared in this scope
   91 |                         if(strlen(com)>6){
      |                            ^~~~~~
a.cc:17:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   16 | #include <cstdlib>
  +++ |+#include <cstring>
   17 | using namespace std;
Language: C++

#include <iostream>
#include <iomanip>
#include <math.h>
#include <fstream>
#include <string>
#include <time.h>
#include <ctime>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;

struct Node{
	int key;
    Node *prev;
	Node *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));
}

void print(){
	Node* cur = nil->next;
	while(cur != nil){
		if(cur != nil->next)printf(" "); 
		printf("%d",cur->key);
		cur = cur->next;
	}
	printf("\n");
}

int main(){

	int key,n;
	int size=0;
	char com[20];
	int np=0,nd=0;
	scanf_s("%d", &n);
	init();
	for(int 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);nd++;
			}
			size--;
		}
	}

	print();

	return 0;
}

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


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

struct Node{
	int key;
    Node *prev;
	Node *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));
}

void print(){
	Node* cur = nil->next;
	while(cur != nil){
		if(cur != nil->next)printf(" "); 
		printf("%d",cur->key);
		cur = cur->next;
	}
	printf("\n");
}

int main(){

	int key,n;
	int size=0;
	char com[20];
	int np=0,nd=0;
	scanf_s("%d", &n);
	init();
	for(int 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--;
		}
	}

	print();

	return 0;
}

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

#include <cstdio>
#include <list>
#include <string>
using namespace std;
#define ll long long
int main(){
	cin.tie(0);
    ios::sync_with_stdio(false);
	int n;
	cin>>n;
	string com;
	int key;
	list<ll> lst;
	list<ll>::iterator it,i=lst.end();
	while(n--){
		cin>>com;
		if(com=="insert"){
			cin>>key;
			lst.push_front(key);
		}
		else if(com=="delete"){
			cin>>key;
			for(it=lst.begin();it!=i;it++){
				if(*it==key){a
					lst.erase(it);
					break;
				}
			}
		}
		else if(com=="deleteFirst")	lst.pop_front();
		else 						lst.pop_back();
		
	}
	i--;
	for(it=lst.begin();it!=i;it++)	cout<<*it<<" ";
	cout<<*i<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin.tie(0);
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <string>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:8:10: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
    8 |     ios::sync_with_stdio(false);
      |          ^~~~~~~~~~~~~~~
a.cc:24:46: error: 'a' was not declared in this scope
   24 |                                 if(*it==key){a
      |                                              ^
a.cc:35:41: error: 'cout' was not declared in this scope
   35 |         for(it=lst.begin();it!=i;it++)  cout<<*it<<" ";
      |                                         ^~~~
a.cc:35:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:9: error: 'cout' was not declared in this scope
   36 |         cout<<*i<<"\n";
      |         ^~~~
a.cc:36:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

//scanf??????????????¨??????????????????????°?????????????
#include<cstdio>
#include<list>
#include<string>
using namespace std;

int main(void) {
	int num,time;
	char str[100];
	list<int> l;

	scanf_s("%d", &time);

	for (int i = 0; i < time; i++) {
		scanf_s("%s", str);
		if (str[0] == 'i') {
			scanf_s("%d", &num);
			l.push_front(num);
		} else if(str[6] == 'F') {
			l.pop_front();
		} else if (str[6] == 'L') {
			l.pop_back();
		} else {//delete?????´???
			scanf_s("%d", &num);
			for (list<int>::iterator i = l.begin(); i != l.end(); i++) {
				if (num == *i) {
					l.erase(i);
					break;
				}
			}
		}
	}
	int j = 0;
	for (list<int>::iterator i = l.begin(); i != l.end(); i++) {
		if (j++) printf(" ");
		printf("%d",*i);
	}
	printf("\n");
	return 0;
}

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

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

int a[1000000]={0}, x, y=0, z=0;
void insert()
{
  a[y] = x;
  y++;
  return;
}

void delete()
{
  int i, j;
  for(i = y-1; i >= 0; i--){
    if(a[i] == x){
      a[i] = -1;
      }
      break;
    }
  return;
}

void deleteLast()
{
  z++;
  return;
}

void deleteFirst()
{
  a[y-1] = -1;
  return;
}

int main()
{
  long long int n, i;
  char str[32];
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%s", str);
    if(str[0] == 'i'){
      scanf("%d", &x);
      insert();
    } else if(str[0] == 'd'){
      if(strlen(str) > 6){
        if(str[6] == 'F') deleteFirst();
        else if(str[6] == 'L') deleteLast();
      } else {
        scanf("%d", &x);
        delete();
      }    
    } 
  }
  for(i = y-1; i >= z; i--){
    if(a[i] != -1){
      if(i == z) printf("%d\n", a[i]);
      else printf("%d ", a[i]);
    }
  }
  return 0;
}

Compiler output:
a.cc:12:6: error: expected unqualified-id before 'delete'
   12 | void delete()
      |      ^~~~~~
a.cc: In function 'int main()':
a.cc:52:16: error: expected primary-expression before ')' token
   52 |         delete();
      |                ^
Language: C++

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

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

Node *nil;

Node* listSearch(nit 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->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:12:18: error: 'nit' was not declared in this scope; did you mean 'nil'?
   12 | Node* listSearch(nit key){
      |                  ^~~
      |                  nil
a.cc: In function 'void deleteKey(int)':
a.cc:57:24: error: 'listSearch' cannot be used as a function
   57 |   deleteNode(listSearch(key));
      |              ~~~~~~~~~~^~~~~
a.cc: In function 'int main()':
a.cc:83:5: error: 'else' without a previous 'if'
   83 |     else if(com[0] == 'd'){
      |     ^~~~
a.cc:97:3: error: 'printList' was not declared in this scope; did you mean 'printlist'?
   97 |   printList();
      |   ^~~~~~~~~
      |   printlist
Language: C++

#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->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:83:5: error: 'else' without a previous 'if'
   83 |     else if(com[0] == 'd'){
      |     ^~~~
a.cc:97:3: error: 'printList' was not declared in this scope; did you mean 'printlist'?
   97 |   printList();
      |   ^~~~~~~~~
      |   printlist
Language: C++

#include <iostream>
#include <deque>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main(){
	deque<long> a;
	long num;
	int n;
	string command;

	cin>>n;
	for(int i=0;i<n;i++){
		cin>>command;
		if((command.length() >= 6) && (command[6] == 'F')){
			a.pop_front();
		}else if((command.length() >= 6) && (command[6] == 'L')){
			a.pop_back();
		}else if(command[0] == 'i'){
			cin>>num;
			a.push_front(num);
		}else if(command == "delete"){
			cin>>num;
			deque<long>::iterator iter;
			iter = find(a.begin(), a.end(), num);
			if(iter != a.end())
				a.erase(iter);
		}
	}

	for (deque<int>::iterator i = d.begin(); i != d.end() - 1; i++){
        cout << *i << " ";
    }
    cout << endl;
 /*
	for(int i=0;i<a.size();i++){
		if(i != 0) cout<<" ";
		cout<<a[i];
	}
	cout<<endl;
	*/
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:39: error: 'd' was not declared in this scope
   34 |         for (deque<int>::iterator i = d.begin(); i != d.end() - 1; i++){
      |                                       ^
Language: C++

#include <iostream>
#include <cstring>

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

Node *nil;

Node* search(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 pirntList() {
    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 -> 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(search(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(void) {
    int key, n;
    int size = 0;
    char com[20];
    int np = 0, nd = 0;
    scanf("%d", &n);
    init();
    for (int 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:6:17: error: field 'prev' has incomplete type 'Node'
    6 |     Node *next, prev;
      |                 ^~~~
a.cc:4:8: note: definition of 'struct Node' is not complete until the closing brace
    4 | struct Node{
      |        ^~~~
a.cc: In function 'int main()':
a.cc:90:5: error: 'printList' was not declared in this scope; did you mean 'pirntList'?
   90 |     printList();
      |     ^~~~~~~~~
      |     pirntList
Language: C++

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

using namespace std;

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

Node *nil;

Node* search(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 pirntList() {
    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 -> 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(search(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(void) {
    int key, n;
    int size = 0;
    char com[20];
    int np = 0, nd = 0;
    scanf("%d", &n);
    init();
    for (int 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:9:17: error: field 'prev' has incomplete type 'Node'
    9 |     Node *next, prev;
      |                 ^~~~
a.cc:7:8: note: definition of 'struct Node' is not complete until the closing brace
    7 | struct Node{
      |        ^~~~
a.cc: In function 'int main()':
a.cc:93:5: error: 'printList' was not declared in this scope; did you mean 'pirntList'?
   93 |     printList();
      |     ^~~~~~~~~
      |     pirntList
Language: C++

#include <cstdio>
#include <stdlib>
#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->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{
                delete(key); nd++;
            }
            size--;
    }
    printList();
}

Compiler output:
a.cc:2:10: fatal error: stdlib: No such file or directory
    2 | #include <stdlib>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

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

Node *nil;

void init() {
    nil = new Node;
    nil->next = nil;
    nil->prev = nil;
}

void insert(int value) {
    Node *node = new Node;
    node->value = value;
    node->next = nil->next;
    nil->next->prev = node;
    nil->next = node;
    node->prev = nil;
}

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

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

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

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

void deleteValue(int value) {
    deleteNode(listSearch(value));
}

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

int main() {

    int n;
    cin >> n;
    init();
    for (int i = 0; i < n; ++i) {
        char command[32];
        cin >> command;
        if (command[0] == 'i') {
            int value;
            cin >> value;
            insert(value);
        } else if (command[0] == 'd') {
            if (strlen(command) > 6) {
                if (command[6] == 'F') deleteFirst();
                else if (command[6] == 'L') deleteLast();
            } else {
                int value;
                cin >> value;
                deleteValue(value);
            }
        }
    }

    print();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:17: error: 'strlen' was not declared in this scope
   79 |             if (strlen(command) > 6) {
      |                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;