Language: C++

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


struct Proc{
	std::string meirei;
	int value;
}
typedef std::list<int> IList;

void input(IList& ilist);
int output(const IList& vec);

int main()
{
    std::cin.tie(0);//??\??????????????????
    std::ios::sync_with_stdio(false);
    IList result;
    input(result);
    output(result);
    return 0;
}
///--------------------------------------------
void input(IList& ilist)
{
    int n;
    std::cin >> n;
    for(int i = 0; i < n; i++){
        Proc command;
        std::cin >> command.meirei;
        if((meirei == "insert")||( meirei == "delete")){
        	std::cin >> command.value;
		}
		calc(ilist, command);
    }
}
        
 void calc(IList&ilist, Proc& command)
{

    if( command.meirei == "deleteFirst"){
        ilist.pop_front();
        // ilist.erase(ilist.begin());
    }else if(command.meirei == "deleteLast"){
        ilist.pop_back();
    }else if(command.meirei =="insert"){
            //???????????????
            ilist.insert(ilist.begin(), command.value);
    }else{//??????
        for(auto itr = ilist.begin(); itr != ilist.end(); ++itr){
            if(*itr == command.value){
	            ilist.erase(itr);
                break;
            }
        }
    }

}
///--------------------------------------------
int output(const IList& intlist)
{
    for(auto itr = intlist.begin(); itr != intlist.end(); ++itr){
        if(itr != (intlist.begin())){
            std::cout << " "  ;
        }
        std::cout << *itr;
    }
    std::cout << std::endl;
    return 0;
}

Compiler output:
a.cc:11:24: error: invalid declarator before 'IList'
   11 | typedef std::list<int> IList;
      |                        ^~~~~
a.cc:13:6: error: variable or field 'input' declared void
   13 | void input(IList& ilist);
      |      ^~~~~
a.cc:13:12: error: 'IList' was not declared in this scope
   13 | void input(IList& ilist);
      |            ^~~~~
a.cc:13:19: error: 'ilist' was not declared in this scope; did you mean 'va_list'?
   13 | void input(IList& ilist);
      |                   ^~~~~
      |                   va_list
a.cc:14:18: error: 'IList' does not name a type
   14 | int output(const IList& vec);
      |                  ^~~~~
a.cc: In function 'int main()':
a.cc:20:5: error: 'IList' was not declared in this scope
   20 |     IList result;
      |     ^~~~~
a.cc:21:11: error: 'result' was not declared in this scope
   21 |     input(result);
      |           ^~~~~~
a.cc:21:5: error: 'input' was not declared in this scope; did you mean 'int'?
   21 |     input(result);
      |     ^~~~~
      |     int
a.cc: At global scope:
a.cc:26:6: error: variable or field 'input' declared void
   26 | void input(IList& ilist)
      |      ^~~~~
a.cc:26:12: error: 'IList' was not declared in this scope
   26 | void input(IList& ilist)
      |            ^~~~~
a.cc:26:19: error: 'ilist' was not declared in this scope; did you mean 'va_list'?
   26 | void input(IList& ilist)
      |                   ^~~~~
      |                   va_list
a.cc:40:7: error: variable or field 'calc' declared void
   40 |  void calc(IList&ilist, Proc& command)
      |       ^~~~
a.cc:40:12: error: 'IList' was not declared in this scope
   40 |  void calc(IList&ilist, Proc& command)
      |            ^~~~~
a.cc:40:18: error: 'ilist' was not declared in this scope; did you mean 'va_list'?
   40 |  void calc(IList&ilist, Proc& command)
      |                  ^~~~~
      |                  va_list
a.cc:40:29: error: expected primary-expression before '&' token
   40 |  void calc(IList&ilist, Proc& command)
      |                             ^
a.cc:40:31: error: 'command' was not declared in this scope
   40 |  void calc(IList&ilist, Proc& command)
      |                               ^~~~~~~
a.cc:62:18: error: 'IList' does not name a type
   62 | int output(const IList& intlist)
      |                  ^~~~~
a.cc: In function 'int output(const int&)':
a.cc:64:28: error: request for member 'begin' in 'intlist', which is of non-class type 'const int'
   64 |     for(auto itr = intlist.begin(); itr != intlist.end(); ++itr){
      |                            ^~~~~
a.cc:64:52: error: request for member 'end' in 'intlist', which is of non-class type 'const int'
   64 |     for(auto itr = intlist.begin(); itr != intlist.end(); ++itr){
      |                                                    ^~~
a.cc:65:28: error: request for member 'begin' in 'intlist', which is of non-class type 'const int'
   65 |         if(itr != (intlist.begin())){
      |                            ^~~~~