Language: C++

#include <iostream>
#include <string>

int main(){
  string S;
  cin >> S;
  
  string c01 = S[0]+S[1];
  string c23 = S[2]+S[3];
  
  int i01 = stoi(c01);
  int i23 = stoi(c23);
  
  if(i01 >= 1 && i01 <=12 && i23 >= 1 && i23 <=12) {
    cout << "AMBIGUOUS" << endl;
  }else if(i01 >= 0 && i23 >= 1 && i23 <=12) {
    cout << "YYMM" << endl;
  }else if( i01 >= 1 && i01 <=12 && i23 >= 0) {
    cout << "MMYY" << endl;
  }else{
    cout << "NA" << endl;
  }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string S;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> S;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'S' was not declared in this scope
    6 |   cin >> S;
      |          ^
a.cc:8:9: error: expected ';' before 'c01'
    8 |   string c01 = S[0]+S[1];
      |         ^~~~
      |         ;
a.cc:9:9: error: expected ';' before 'c23'
    9 |   string c23 = S[2]+S[3];
      |         ^~~~
      |         ;
a.cc:11:18: error: 'c01' was not declared in this scope; did you mean 'i01'?
   11 |   int i01 = stoi(c01);
      |                  ^~~
      |                  i01
a.cc:11:13: error: 'stoi' was not declared in this scope; did you mean 'std::__cxx11::stoi'?
   11 |   int i01 = stoi(c01);
      |             ^~~~
      |             std::__cxx11::stoi
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:4432:3: note: 'std::__cxx11::stoi' declared here
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:12:18: error: 'c23' was not declared in this scope; did you mean 'i23'?
   12 |   int i23 = stoi(c23);
      |                  ^~~
      |                  i23
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout << "AMBIGUOUS" << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |     cout << "AMBIGUOUS" << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:17:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |     cout << "YYMM" << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |     cout << "YYMM" << endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout << "MMYY" << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |     cout << "MMYY" << endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:21:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |     cout << "NA" << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |     cout << "NA" << endl;
      |                     ^~~~
      |                     std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~