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

#include <stdio.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->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 = nil;
}

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

  return 0;
}


Compiler output:
main.c:2:10: fatal error: cstdio: No such file or directory
    2 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

int main(){
    list<ll> l;
    list<ll> ::iterator it;
    int N; cin >> N;
    while(N--){
        string op; cin >> op;
        int x;
        if(op == "insert"){
            cin >> x;
            l.push_front(x);
        }else if(op == "delete"){
            cin >> x;
            for (it = l.begin(); it != l.end(); it++)
                if(*it == x)
                    l.erase(it);
        }else if(op == "deleteFirst")
            l.pop_front();
        else
            l.pop_back();
    }
    for (it = l.begin(); it != l.end(); it++)
        cout << *it << ' ';
    cout << '\n';
}



Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

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


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

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


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

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

#define MAX 200000

typedef struct node {
	//データ//
	char command[13];//命令
	int number;//数字
	//データ//
	struct node *prev;//前へ
	struct node *next;//次へ
}node;

int main(void)
{
	char C_input[13],//commandに格納する文字列
		instruction[4][12] = { "insert", "delete", "deleteFirst", "deleteLast", };//配列変数commandを単一変数で格納する

	int array[MAX] = { 0 }, a_idx = 0,
		all_number,//入力数
		I_input,//数字
		f_cnt,//ループカウント
		w_cnt,//ループカウント
		dlt_cnt = 0,//deleteした数
		true_cnt = 0;//エラー回避
		

	node *P_node, *fst_node, *FR_P;

	scanf("%d", &all_number);
	
	P_node = malloc(sizeof(node));//最初の構造体を作る


	for (f_cnt = 0; f_cnt < all_number; f_cnt++) {//構造体に双方向連結のためのポインタと、コマンドを入れるループ

		scanf("%s", P_node->command);

		if (strcmp(P_node->command, instruction[0]) == 0 || strcmp(P_node->command, instruction[1]) == 0) {//"insert" or "delete"であった場合
			scanf("%d", &P_node->number);
		}
		else {
			P_node->number = 0;
		}
		

		
		

		if (f_cnt + 1 == all_number) {//最後の構造体ならNULL
			P_node->next = NULL;
		}
		else {
			P_node->next = malloc(sizeof(node));
		}


		if (f_cnt == 0) {//最初の構造体ならそれ以前の構造体は存在しないのでNULL
			fst_node = P_node;
			P_node->prev = NULL;
		}
		else if (f_cnt + 1 == all_number) {}//最後の構造体なら何も入力しない
		else {
			P_node->next->prev = P_node;//次の構造体のprevに前の構造体（今判定している構造体）のポインタを入れる
		}

		
		if(strcmp(P_node->command, instruction[0]) == 0){//先頭に数字を入れる
			array[a_idx] = P_node->number;
			a_idx++;
		}

		else if (strcmp(P_node->command, instruction[1]) == 0) {//数字を指定し、それが配列内にあれば消去してその分を詰める
			w_cnt = a_idx;
			while (w_cnt != -1) {//指定した数字が配列に格納されていないかを検索するループ
				if (P_node->number == array[w_cnt]) {

					while (w_cnt != a_idx + 1) {
						array[w_cnt] = array[w_cnt + 1];
						w_cnt++;
					}

					dlt_cnt += 2;
					a_idx--;
					true_cnt = 1;
					break;
				}
				w_cnt--;
			}
			if (true_cnt == 1) {
				true_cnt = 0;
			}
			else {//指定した数字が配列に格納されていない場合
				dlt_cnt++;
			}
		}

		else if (strcmp(P_node->command, instruction[2]) == 0) {//最後の格納されている数字を消去する
			array[a_idx - 1] = 0;
			dlt_cnt += 2;
			a_idx--;
		}

		else if (strcmp(P_node->command, instruction[3]) == 0) {//最初に格納されている数字を消去してその分詰める
			for (w_cnt = 0; w_cnt < all_number - dlt_cnt; w_cnt++) {
				array[w_cnt] = array[w_cnt + 1];
			}
			dlt_cnt+= 2;
			a_idx--;
		}

		else { break; }

		FR_P = P_node;

		P_node = P_node->next;//次の構造体へ

		free(FR_P);

	}

	
	w_cnt = f_cnt - dlt_cnt - 1;//配列の先頭から出力するため

	while (w_cnt != -1) {
		printf("%d", array[w_cnt]);
		w_cnt--;
		if (w_cnt != -1) {
			putchar(' ');
		}
	}

	putchar('\n');


	return 0;

}


Compiler output:
main.c:1:1: error: stray '##' in program
    1 | ##define _CRT_SECURE_NO_WARNINGS
      | ^~
main.c:1:3: error: unknown type name 'define'
    1 | ##define _CRT_SECURE_NO_WARNINGS
      |   ^~~~~~
main.c:1:33: error: expected ';' before 'typedef'
    1 | ##define _CRT_SECURE_NO_WARNINGS
      |                                 ^
      |                                 ;
Language: C

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

#define MAX 20000

typedef struct node {
	//データ//
	char command[13];//命令
	int number;//数字
	//データ//
	struct node *prev;//前へ
	struct node *next;//次へ
}node;

int main(void)
{
	char C_input[13],//commandに格納する文字列
		instruction[4][12] = { "insert", "delete", "deleteFirst", "deleteLast", };//配列変数commandを単一変数で格納する

	int array[MAX] = { 0 }, a_idx = 0,
		all_number,//入力数
		I_input,//数字
		f_cnt,//ループカウント
		w_cnt,//ループカウント
		dlt_cnt = 0,//deleteした数
		true_cnt = 0;//エラー回避
		

	node *P_node, *fst_node, *FR_P;

	scanf("%d", &all_number);
	
	P_node = malloc(sizeof(node));//最初の構造体を作る


	for (f_cnt = 0; f_cnt < all_number; f_cnt++) {//構造体に双方向連結のためのポインタと、コマンドを入れるループ

		scanf("%s", P_node->command);

		if (strcmp(P_node->command, instruction[0]) == 0 || strcmp(P_node->command, instruction[1]) == 0) {//"insert" or "delete"であった場合
			scanf("%d", &P_node->number);
		}
		else {
			P_node->number = 0;
		}
		

		
		

		if (f_cnt + 1 == all_number) {//最後の構造体ならNULL
			P_node->next = NULL;
		}
		else {
			P_node->next = malloc(sizeof(node));
		}


		if (f_cnt == 0) {//最初の構造体ならそれ以前の構造体は存在しないのでNULL
			fst_node = P_node;
			P_node->prev = NULL;
		}
		else if (f_cnt + 1 == all_number) {}//最後の構造体なら何も入力しない
		else {
			P_node->next->prev = P_node;//次の構造体のprevに前の構造体（今判定している構造体）のポインタを入れる
		}

		
		if(strcmp(P_node->command, instruction[0]) == 0){//先頭に数字を入れる
			array[a_idx] = P_node->number;
			a_idx++;
		}

		else if (strcmp(P_node->command, instruction[1]) == 0) {//数字を指定し、それが配列内にあれば消去してその分を詰める
			w_cnt = a_idx;
			while (w_cnt != -1) {//指定した数字が配列に格納されていないかを検索するループ
				if (P_node->number == array[w_cnt]) {

					while (w_cnt != a_idx + 1) {
						array[w_cnt] = array[w_cnt + 1];
						w_cnt++;
					}

					dlt_cnt += 2;
					a_idx--;
					true_cnt = 1;
					break;
				}
				w_cnt--;
			}
			if (true_cnt == 1) {
				true_cnt = 0;
			}
			else {//指定した数字が配列に格納されていない場合
				dlt_cnt++;
			}
		}

		else if (strcmp(P_node->command, instruction[2]) == 0) {//最後の格納されている数字を消去する
			array[a_idx - 1] = 0;
			dlt_cnt += 2;
			a_idx--;
		}

		else if (strcmp(P_node->command, instruction[3]) == 0) {//最初に格納されている数字を消去してその分詰める
			for (w_cnt = 0; w_cnt < all_number - dlt_cnt; w_cnt++) {
				array[w_cnt] = array[w_cnt + 1];
			}
			dlt_cnt+= 2;
			a_idx--;
		}

		else { break; }

		FR_P = P_node;

		P_node = P_node->next;//次の構造体へ

		free(FR_P);

	}

	
	w_cnt = f_cnt - dlt_cnt - 1;//配列の先頭から出力するため

	while (w_cnt != -1) {
		printf("%d", array[w_cnt]);
		w_cnt--;
		if (w_cnt != -1) {
			putchar(' ');
		}
	}

	putchar('\n');


	return 0;

}


Compiler output:
main.c:1:1: error: stray '##' in program
    1 | ##define _CRT_SECURE_NO_WARNINGS
      | ^~
main.c:1:3: error: unknown type name 'define'
    1 | ##define _CRT_SECURE_NO_WARNINGS
      |   ^~~~~~
main.c:1:33: error: expected ';' before 'typedef'
    1 | ##define _CRT_SECURE_NO_WARNINGS
      |                                 ^
      |                                 ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct list{
  struct list *next;
  struct list *prev;
  int n;
};
struct list *ls;
void init();
void insert(int);
void delete(int);
void print();
void deleteFirst();
void deleteLast();
int main(){
  int n,i,com;
  char command[13];
  init();
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(!strcmp(command,"deleteFirst"))deleteFirst();
    else if(!strcmp(command,"deleteLast"))deleteLast();
    else{
      scanf("%d",&com);
        if(!strcmp(command,"insert")) insert(com);
        else if(!strcmp(command,"delete"))  delete(com);
    }
  }
  print();

  return 0;
}
void init(){
  ls=(struct list *)malloc(sizeof(struct list));
  ls->next=ls;
  ls->prev=ls;
}
void insert(int com){
  struct list *array;
  array=(struct list *)malloc(sizeof(struct list));
  array->n=com;
  ls->next->prev=array;
  array->next=ls->next;
  array->prev=ls;
  ls->next=array;
}
void print(){
  struct list *a=ls->next;
  while(1){
    printf("%d ",a->n);
    if(a->next==ls){
        printf("\n")
        return;
    }
    a=a->next;
    free(a->prev);
  }
}
void delete(int x){
  struct list *a=ls->next;
  while(1){
    if(a==ls)return;
    if(a->n==x){
      a->prev->next=a->next;
      a->next->prev=a->prev;
      free(a);
      return;
    }
    a=a->next;
  }
}

void deleteFirst(){
  ls->next=ls->next->next;
  ls->next->prev=ls;
}
void deleteLast(){
  struct list *a;
  for(a=ls->next;a->next!=ls;a=a->next){
  }
  a->prev->next=ls;
  free(a);
}


Compiler output:
main.c: In function 'print':
main.c:54:21: error: expected ';' before 'return'
   54 |         printf("\n")
      |                     ^
      |                     ;
   55 |         return;
      |         ~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct list{
  struct list *next;
  struct list *prev;
  int n;
};
struct list *ls;
void init();
void insert(int);
void delete(int);
void print();
void deleteFirst();
void deleteLast();
int main(){
  int n,i,com;
  char command[13];
  init();
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(!strcmp(command,"deleteFirst"))deleteFirst();
    else if(!strcmp(command,"deleteLast"))deleteLast();
    else{
      scanf("%d",&com);
        if(!strcmp(command,"insert")) insert(com);
        else if(!strcmp(command,"delete"))  delete(com);
    }
  }
  print();

  return 0;
}
void init(){
  ls=(struct list *)malloc(sizeof(struct list));
  ls->next=ls;
  ls->prev=ls;
}
void insert(int com){
  struct list *array;
  array=(struct list *)malloc(sizeof(struct list));
  array->n=com;
  ls->next->prev=array;
  array->next=ls->next;
  array->prev=ls;
  ls->next=array;
}
void print(){
  struct list *a=ls->next;
  while(1){
    printf("%d ",a->n);
    if(a->next==ls){
        printf("\n"):
        return;
    }
    a=a->next;
    free(a->prev);
  }
}
void delete(int x){
  struct list *a=ls->next;
  while(1){
    if(a==ls)return;
    if(a->n==x){
      a->prev->next=a->next;
      a->next->prev=a->prev;
      free(a);
      return;
    }
    a=a->next;
  }
}

void deleteFirst(){
  ls->next=ls->next->next;
  ls->next->prev=ls;
}
void deleteLast(){
  struct list *a;
  for(a=ls->next;a->next!=ls;a=a->next){
  }
  a->prev->next=ls;
  free(a);
}


Compiler output:
main.c: In function 'print':
main.c:54:21: error: expected ';' before ':' token
   54 |         printf("\n"):
      |                     ^
      |                     ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct list{
  struct list *next;
  struct list *prev;
  int n;
};
struct list *ls;
void init();
void insert(int);
void delete(int);
void print();
void deleteFirst();
void deleteLast();
int main(){
  int n,i,com;
  char command[13];
  init();
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(!strcmp(command,"deleteFirst"))deleteFirst();
    else if(!strcmp(command,"deleteLast"))deleteLast();
    else{
      scanf("%d",&com);
        if(!strcmp(command,"insert")) insert(com);
        else if(!strcmp(command,"delete"))  delete(com);
    }
  }
  print();

  return 0;
}
void init(){
  ls=(struct list *)malloc(sizeof(struct list));
  ls->next=ls;
  ls->prev=ls;
}
void insert(int com){
  struct list *array;
  array=(struct list *)malloc(sizeof(struct list));
  array->n=com;
  ls->next->prev=array;
  array->next=ls->next;
  array->prev=ls;
  ls->next=array;
}
void print(){
  struct list *a=ls->next;
  while(1){
    printf("%d",a->n);
    if(a->next==ls){
        printf("\n");
        return;
    }
    printf(" ");
    a=a->next;
    free(a->prev);
  }
}
void delete(int x){
  struct list *a=ls->next;
  while(1){
    if(a==ls)return;
    if(a->n==x){
      a->prev->next=a->next;
      a->next->prev=a->prev;
      free(a);
      return;
    }
    a=a->next;
  }
}

void deleteFirst(){
  ls->next=ls->next->next;
  ls->next->prev=ls;
}
void deleteLast(){
  ls->prev->prev=ls;
  ls->next->preb=ls->prev
}


Compiler output:
main.c: In function 'deleteLast':
main.c:82:13: error: 'struct list' has no member named 'preb'; did you mean 'prev'?
   82 |   ls->next->preb=ls->prev
      |             ^~~~
      |             prev
main.c:82:26: error: expected ';' before '}' token
   82 |   ls->next->preb=ls->prev
      |                          ^
      |                          ;
   83 | }
      | ~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct list{
  struct list *next;
  struct list *prev;
  int n;
};
struct list *ls;
void init();
void insert(int);
void delete(int);
void print();
void deleteFirst();
void deleteLast();
int main(){
  int n,i,com;
  char command[13];
  init();
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(!strcmp(command,"deleteFirst"))deleteFirst();
    else if(!strcmp(command,"deleteLast"))deleteLast();
    else{
      scanf("%d",&com);
        if(!strcmp(command,"insert")) insert(com);
        else if(!strcmp(command,"delete"))  delete(com);
    }
  }
  print();

  return 0;
}
void init(){
  ls=(struct list *)malloc(sizeof(struct list));
  ls->next=ls;
  ls->prev=ls;
}
void insert(int com){
  struct list *array;
  array=(struct list *)malloc(sizeof(struct list));
  array->n=com;
  ls->next->prev=array;
  array->next=ls->next;
  array->prev=ls;
  ls->next=array;
}
void print(){
  struct list *a=ls->next;
  while(1){
    printf("%d",a->n);
    if(a->next==ls){
        printf("\n");
        return;
    }
    printf(" ");
    a=a->next;
    free(a->prev);
  }
}
void delete(int x){
  struct list *a=ls->next;
  while(1){
    if(a==ls)return;
    if(a->n==x){
      a->prev->next=a->next;
      a->next->prev=a->prev;
      free(a);
      return;
    }
    a=a->next;
  }
}

void deleteFirst(){
  ls->next=ls->next->next;
  ls->next->prev=ls;
}
void deleteLast(){
  ls->prev->prev=ls;
  ls->next->preb=ls->prev;
}


Compiler output:
main.c: In function 'deleteLast':
main.c:82:13: error: 'struct list' has no member named 'preb'; did you mean 'prev'?
   82 |   ls->next->preb=ls->prev;
      |             ^~~~
      |             prev
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct list{
  struct list *next;
  struct list *prev;
  int n;
};
struct list *ls;
void init();
void insert(int,int);
void delete(int);
void print();
void deleteFirst();
void deleteLast();
int main(){
  int n,i,com;
  char command[13];
  init();
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(!strcmp(command,"deleteFirst"))deleteFirst();
    else if(!strcmp(command,"deleteLast"))deleteLast();
    else{
      scanf("%d",&com);
        if(!strcmp(command,"insert")) insert(com,i);
        else if(!strcmp(command,"delete"))  delete(com);
    }
  }
  print();

  return 0;
}
void init(){
  ls=(struct list *)malloc(sizeof(struct list));
  ls->next=ls;
  ls->prev=ls;
}
void insert(int com,int i){
  struct list *array;
  array=(struct list *)malloc(sizeof(struct list));
  array->n=com;
  ls->next->prev=array;
  array->next=ls->next;
  array->prev=ls;
  ls->next=array;
  if(i==0)ls->prev=array;
}
void print(){
  struct list *a=ls->next;
  while(1){
    printf("%d",a->n);
    if(a->next==ls){
        return;
    }
    printf(" ");
    a=a->next;
    free(a->prev);
  }
}
void delete(int x){
  struct list *a=ls->next;
  while(1){
    if(a==ls)return;
    if(a->n==x){
      a->prev->next=a->next;
      a->next->prev=a->prev;
      free(a);
      return;
    }
    a=a->next;
  }
}

void deleteFirst(){
  ls->next=ls->next->next;
  ls->next->prev=ls;
}
void deleteLast(){
  ls->prev->prev=ls;
  ls->->prev=ls->prev;
}


Compiler output:
main.c: In function 'deleteLast':
main.c:82:7: error: expected identifier before '->' token
   82 |   ls->->prev=ls->prev;
      |       ^~
Language: C

#include<iostream>
using namespace std;

struct Card { char suit, value; };

void bubble(struct Card A[],int N){
  for(int i = 0; i < N; i++){
    for(int j = N - 1; j >= i + 1; j--){
      if(A[j].value < A[j - 1].value){
	Card t = A[j];
	A[j] = A[j - 1];
	A[j - 1] = t;
      }
    }
  }
}

void selection(struct Card A[],int N){
  for(int i = 0; i < N; i++){
    int minj = i;
    for(int j = i; j < N; j++){
      if(A[j].value < A[minj].value) minj = j;
    }
    Card t = A[i];
    A[i] = A[minj];
    A[minj] = t;
  }
}

void print(struct Card A[], int N){
  for(int i = 0; i < N; i++){
    if (i > 0)cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

bool isStable(struct Card C1[],struct Card C2[],int N){
   for(int i = 0; i < N; i++){
     if(C1[i].suit != C2[i].suit)return false;
   }
   return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> C1[i].suit >> C1[i].value;
  }

  for(int i = 0; i < N; i++)C2[i] = C1[i];

  bubble(C1,N);
  selection(C2,N);

  print(C1,N);
  cout << "Stable" << endl;
  print(C2,N);
  if(isStable(C1,C2,N)){
    cout << "Stable" << endl;
  }
  else {
    cout << "Not stable" << endl;
  }
  return 0;
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

/* 
 * File:   main.c
 * Author: Ivan
 *
 * Created on June 25, 2018, 7:45 PM
 */

#include <cstdio>
#include <cstdlib>

struct Item {
    int key;
    Item *next, *prev;
};
//typedef struct{
//    int key;
//    Item *next;
//    Item *prev;
//}Item;

Item *null;

Item *search(int key);

void print();

void deleteItem(Item *m);

void deleteKey(int key);

void insert(int key);

/*
 * 
 */

//int main(int argc, char** argv) {
int main() {
    int key, n, np = 0, nd = 0, size = 0;
    char command[50];
    
    scanf("%d", &n);
    
    null = (Item *)malloc(sizeof(Item));
    null->next = null;
    null->prev = null;
    
    for (int i = 0; i < n; ++i)
    {
        scanf("%s%d", command, &key);
        if (command == "insert") { insert(key); np++; size++; }
        else if ( command == "deleteFirst") { deleteItem(null->next); size--; }
        else if ( command == "deleteLast") { deleteItem(null->prev); size--; }
        else { deleteKey(key); size--; }
    }
    
    print();
    
    return (EXIT_SUCCESS);
}

Item* search(int key)
{
    Item *current = null->next;
    while ( current != null && current->key != key)
    {
        current = current->next;
    }
    return current;
}

void print()
{
    Item *current = null->next;
    printf("%d", current->key);
    while (1)
    {
        if (current == null) break;
        printf(" ");
        printf("%d", current->key);
        current = current->next;
    }
    printf("\n");
}

void deleteItem(Item *m)
{
    if (m == null) return;
    m->prev->next = m->next;
    m->next->prev = m->prev;
    free(m);
}

void deleteKey(int key)
{
    deleteItem(search(key));
}

void insert(int key)
{
    Item *x = (Item *)malloc(sizeof(Item));
    x->key = key;
    x->next = null->next;
    null->next->prev = x;
    null->next = x;
    x->prev = null;
}



Compiler output:
main.c:8:10: fatal error: cstdio: No such file or directory
    8 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

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

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

struct Node *nil;

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

void insert(int key){
  struct 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:
main.c: In function 'init':
main.c:21:15: error: expected expression before ')' token
   21 |   nil = (Node*)malloc(sizeof(Node));
      |               ^
main.c: In function 'insert':
main.c:58:26: error: expected expression before ')' token
   58 |   struct Node *x = (Node*)malloc(sizeof(Node));
      |                          ^
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);
}



Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
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[0] == 'F' ) deleteFirst();
	  else if ( com[6] == 'L' ) deleteLast();
      } else {
	deleteKey(key); nd++;
      }
      size--;
    }
  }

  printList();

  return 0;
}



Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
struct node{
  int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node * NodePointer;
 
struct node nil;
 
int flag=0;
NodePointer last;
 
void insert(int key);
void delete(int key);
void deleteFirst();
void deleteLast();
void init(){
    nil.next=NULL;
    nil.prev=NULL;
}
 
int main(){
    int n, i, key;
    char com[12];
    NodePointer p;
  scanf("%d", &n);
  init();
 
    for (i=0;i<n;i++){
        scanf("%s",com);
        if(strlen(com)>6){
            if(com[6]=='F') {
                deleteFirst();
            }else{
                deleteLast();
            }
        }else{
            scanf("%d",&key);
            if(com[0]=='i'){
                insert(key);
            }else{
                delete(key);
            }
        }
    }
    for(p=nil.next;p->next!=NULL;p=p->next){
        printf("%d ",p->key);
    }
    printf("%d\n",p->key);
    return 0;
}
 
void insert(int key){
    NodePointer x;
    flag++;
    x=(NodePointer)malloc(sizeof(struct node));
    x->key=key;
    x->next=nil.next;
    x->prev=&nil;
    nil.next=x;
    if(flag>1)x->next->prev=x;
    else if(flag==1)last=x;
}
 
void delete(int key){
    NodePointer p,q;
    p=nil.next;
    while(p!=NULL&&p->key!=key){
        q=p;
        p=p->next;
    }
    if(p!=NULL){
        if(p==last){
            deleteLast();
            last=q;
        }else if(p==nil.next){
            deleteFirst();
        }else{
            q->next=p->next;
            p->next->prev=q;
            free(p);
            flag--;
        }
    }
}
 
int deleteFirst(){
    NodePointer p,q;
    if(flag<1)return 0;
    p=nil.next;
    q=&nil;
    p->next->prev=q;
    nil.next=p->next;
    free(p);
    flag--;
    return 0;
}
 
int deleteLast(){
    NodePointer p;
    if(flag<1)return 0;
    p=last;
    p->prev->next=NULL;
    free(p);
    flag--;
    last=last->prev;
    return 0;
}

Compiler output:
main.c:92:5: error: conflicting types for 'deleteFirst'; have 'int()'
   92 | int deleteFirst(){
      |     ^~~~~~~~~~~
main.c:20:6: note: previous declaration of 'deleteFirst' with type 'void()'
   20 | void deleteFirst();
      |      ^~~~~~~~~~~
main.c:104:5: error: conflicting types for 'deleteLast'; have 'int()'
  104 | int deleteLast(){
      |     ^~~~~~~~~~
main.c:21:6: note: previous declaration of 'deleteLast' with type 'void()'
   21 | void deleteLast();
      |      ^~~~~~~~~~
Language: C

/*s1190073  Rina Sato
 File name: prog3c.c
 This is Doubly Linked List program.*/

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

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

typedef struct node * NodePointer;

NodePointer nil;

void init();
void insert(int);
void deleteFirst();
void deleteLast();
void delete(int);

int main(){
  int key,n,i;
  char com[2000000];
  
  scanf("%d",&n);
  init();

  for(i = 0 ; i < n ; i++){
    scanf("%s",com);
    
    if(com[0] == 'i'){
      scanf("%d",&key);
      insert(key);
    }
    else if(com[0] == 'd'){
      if(strlen(com) > 6){
	if(com[6] == 'F'){
	  deleteFirst();
	}
	else if(com[6] == 'L'){
 	  deleteLast();
	}
      }
      else {
	scanf("%d",&key);
	delete(key);
      }
    }
  }
  for(key = nil->next ; key->next == nil ; key->next){
    printf("%d",node->key);
  }
  return 0;
}

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

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

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

void delete(int key){
  NodePointer n;
  n = malloc(sizeof(struct node));
  for(n = nil->next ; n->next != nil ; n->next){
    if(n->key == key) break;
  }
  free(n);
}

Compiler output:
main.c: In function 'main':
main.c:54:11: error: assignment to 'int' from 'struct node *' makes integer from pointer without a cast [-Wint-conversion]
   54 |   for(key = nil->next ; key->next == nil ; key->next){
      |           ^
main.c:54:28: error: invalid type argument of '->' (have 'int')
   54 |   for(key = nil->next ; key->next == nil ; key->next){
      |                            ^~
main.c:54:47: error: invalid type argument of '->' (have 'int')
   54 |   for(key = nil->next ; key->next == nil ; key->next){
      |                                               ^~
main.c:55:17: error: 'node' undeclared (first use in this function)
   55 |     printf("%d",node->key);
      |                 ^~~~
main.c:55:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
  
struct node{
  int key;
  struct node *next;
  struct node *prev;
};
  
typedef struct node * NodePointer;
  
NodePointer nil;
void insert(int key);
int delete(int key);
int deleteFirst();
int deleteLast();
void init();     /* This fanction is initializing nil. */ 
  
main(){
  int n, i, keydata;
  char com[12];
  NodePointer p;
  scanf("%d",&n);
  nil=malloc(sizeof(struct node));
  init();
   
  for (i=0;i<n;i++){
    scanf("%s",com);
    if(strlen(com)>6){
      if(com[6]=='F') {
    deleteFirst();
      }else{
    deleteLast();
      }
    }else{
      scanf("%d",&keydata);
      if(com[0]=='i'){
    insert(keydata);
      }else{
    delete(keydata);
      }
    }
  }
 
  for(p=nil->next;p!=nil->prev;p=p->next){
    printf("%d ",p->key);
  }
  printf("%dn",p->key);
  free(nil);
  return 0;
}
  
void insert(int keydata){
    NodePointer x;
    x=malloc(sizeof(struct node));
    x->key=keydata;
    x->next=nil->next;
    x->prev=nil;
    nil->next=x;
    x->next->prev=x;
}
  
int delete(int keydata){
  NodePointer p;
  p=nil->next;
  while(p!=nil&&p->key!=keydata){
    p=p->next; /* search */
  }
  if(p==nil){  /* If not found, this function is forced termination.  */
    return 0;
  }else{
    p->prev->next=p->next;
    p->next->prev=p->prev;
    free(p);
    return 0;
  }
}
  
int deleteFirst(){
    NodePointer p;
    p=nil->next;
    nil->next=p->next;
    p->next->prev=nil;
    free(p);
    return 0;
}
  
int deleteLast(){
    NodePointer p;
    p=nil->prev;
    p->prev->next=nil;
    nil->prev=p->prev;
    free(p);
    return 0;
}
 
void init(){
  nil->next=nil;
  nil->prev=nil;

Compiler output:
main.c:20:1: error: return type defaults to 'int' [-Wimplicit-int]
   20 | main(){
      | ^~~~
main.c: In function 'init':
main.c:100:3: error: expected declaration or statement at end of input
  100 |   nil->prev=nil;
      |   ^~~
Language: C

#include<string>
#include<list>
#include<iostream>
using namespace std;
int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  string str;
  list<int> data;
  list<int>::iterator it,l;
  int n,x;
  cin >> n;
  while(n--){
    cin >> str;
    if(str == "insert"){
      cin >> x;
      data.push_front(x);
    }else if(str == "delete"){
      cin >> x;
      for(it=data.begin(),l=data.end();it!=l;++it){
	if(*it == x){
	  data.erase(it);
	  break;
	}
      }
    }else if(str == "deleteFirst") data.pop_front();
    else data.pop_back();
  }
  for(it=data.begin(),l=--data.end();it!=l;++it) cout << *it << " ";
  cout << *it << endl;
}

Compiler output:
main.c:1:9: fatal error: string: No such file or directory
    1 | #include<string>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<list>
#include<algorithm>
  
#define NMAX 2000000+10
using namespace std;
   
  
   
int main(void){
   
    int n;
    string inp;
    int x;
    list<int> data;
    list<int>::iterator iter,fun;
  
    cin>>n;
   
    while(n--){

        cin>>inp;
        
		if(inp.length()!=6){
			if(inp[6]=='F') data.pop_front();
			else if(inp[6]=='L') data.pop_back();
		}
		else{
			cin>>x;
			if(inp[0]=='i') data.push_front(x);
			else{
				fun=find(data.begin(),data.end(),x);
				if(fun!=data.end()) data.erase(fun);
			}
		}
	}
   
    iter=data.begin();
    while(iter!=data.end()){
        if(iter!=data.begin()) cout<<" ";
        cout<<*iter;
        iter++;
    }
    cout<<endl;
  
    return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

import java.util.Scanner;
class Node{
	Node prev;
	Node next;
	String n;
	Node(){
		prev=this;
		next=this;
	}
	Node(Node prev,Node next,String data){
		n=data;
		this.prev=prev;
		this.next=next;
	}
}
public class Main{
	static Node head=new Node();
	static Node crnt=head;
	
	static void add(String x){
		Node tmp=new Node(crnt,crnt.next,x);
		crnt.next=crnt.next.prev=tmp;
		crnt=tmp;
	}
	
	static void insert(String x){
		crnt=head;
		add(x);
	}
	
	static boolean isEmpty(){
		return head.next==head;
	}
	
	static void removeCurrentNode(){
		if(!isEmpty()){
			crnt.prev.next=crnt.next;
			crnt.next.prev=crnt.prev;
			crnt=crnt.prev;
		}
	}
	
	static void deleteFirst(){//リストの先頭の要素を削除
		crnt=head.next;
		removeCurrentNode();
		
	}
	
	static void deleteLast(){
		crnt=head.prev;
		removeCurrentNode();
	}
	
	static void deleteX(String x){
		crnt=head.next;
		while(crnt!=head){
			if(crnt.n.equals(x)){
				removeCurrentNode();
				break;
			}
			crnt=crnt.next;
		}
	}
	
	static void output(){
		crnt=head.next;
		if(!isEmpty()){
			System.out.print(crnt.n);
			crnt=crnt.next;
			while(crnt!=head){
				System.out.print(" "+crnt.n);
				crnt=crnt.next;
			}
			System.out.println();
		}
	}
	
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String s;
		String x;
		int n=scan.nextInt();
		for(int i=0;i<n;i++){
			s=scan.next();
			if(s.equals("insert")){
				x=scan.next();
				insert(x);
			}else if(s.equals("delete")){
				x=scan.next();
				deleteX(x);
			}else if(s.equals("deleteFirst")){
				deleteFirst();
			}else{
				deleteLast();
			}
		}
		output();
		scan.close();
	}

}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'class'
    2 | class Node{
      | ^~~~~
main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | class Node{
      |           ^
main.c:16:1: error: unknown type name 'public'
   16 | public class Main{
      | ^~~~~~
main.c:16:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
   16 | public class Main{
      |              ^~~~
Language: C

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

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

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
	NodePointer cur = nil->next;
	while (cur != nil){
		if (key == cur->key){ return cur; }
		cur = cur->next;
	}
	return NULL;
}

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

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

void deleteNode(NodePointer t){
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

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

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

void delete(int key){
	NodePointer t = listSearch(key);
	if (t == NULL)return;
	deleteNode(t);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

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

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

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
	NodePointer cur = nil->next;
	while (cur != nil){
		if (key == cur->key){ return cur; }
		cur = cur->next;
	}
	return NULL;
}

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

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

void deleteNode(NodePointer t){
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

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

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

void delete(int key){
	NodePointer t = listSearch(key);
	if (t == NULL)return;
	deleteNode(t);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

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

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

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
  NodePointer x;
  for(x = nil->next;x->next!=nil;x=x->next){
  if(x->key==key)return x;
  }
  return;
}

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

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

void deleteNode(NodePointer t){


  t->next->prev=t->prev;
  t->prev->next=t->next;

  free(t);
}

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

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

void delete(int key){
  NodePointer t =l istSearch(key);
  deleteNode(t);
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;

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


}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
	if ( com[6] == 'F' ) deleteFirst();
	else if ( com[6] == 'L' ) deleteLast();
      } else {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
main.c: In function 'listSearch':
main.c:20:3: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   20 |   return;
      |   ^~~~~~
main.c:15:13: note: declared here
   15 | NodePointer listSearch(int key){
      |             ^~~~~~~~~~
main.c: In function 'delete':
main.c:64:18: error: 'l' undeclared (first use in this function)
   64 |   NodePointer t =l istSearch(key);
      |                  ^
main.c:64:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:64:20: error: expected ',' or ';' before 'istSearch'
   64 |   NodePointer t =l istSearch(key);
      |                    ^~~~~~~~~
Language: C

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

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

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
  /* your code */
}

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

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

void deleteNode(NodePointer t){
  /* your code */
  t->prev->next = t->next;
  t->next->prev = t->prev;

}

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

void deleteLast(){
  /* your code */
  deleteNode(d);
}

void delete(int key){
  /* your code */
  NodePointer d;
  d=listSearch(key);
  deleteNode(d);
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;

  /* your code */
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x
  x->prev = nil
  


}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
	if ( com[6] == 'F' ) deleteFirst();
	else if ( com[6] == 'L' ) deleteLast();
      } else {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
main.c: In function 'deleteLast':
main.c:53:14: error: 'd' undeclared (first use in this function)
   53 |   deleteNode(d);
      |              ^
main.c:53:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:72:16: error: expected ';' before 'x'
   72 |   nil->next = x
      |                ^
      |                ;
   73 |   x->prev = nil
      |   ~
Language: C

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

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

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
  NodePointer x = nil->next;
  while(x->key != key){
    if(x->next == nil) break;
    x = x->next;
  }
  return x;
}

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

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

void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

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

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

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


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

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
	if ( com[6] == 'F' ) deleteFirst();
	else if ( com[6] == 'L' ) deleteLast();
      } else {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}

Compiler output:
main.c: In function 'init':
main.c:26:21: error: implicit declaration of function 'deleteNode' [-Wimplicit-function-declaration]
   26 |   nil->next = nil;  deleteNode(t);
      |                     ^~~~~~~~~~
main.c:26:32: error: 't' undeclared (first use in this function)
   26 |   nil->next = nil;  deleteNode(t);
      |                                ^
main.c:26:32: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:43:6: warning: conflicting types for 'deleteNode'; have 'void(struct node *)'
   43 | void deleteNode(NodePointer t){
      |      ^~~~~~~~~~
main.c:26:21: note: previous implicit declaration of 'deleteNode' with type 'void(struct node *)'
   26 |   nil->next = nil;  deleteNode(t);
      |                     ^~~~~~~~~~