Language: C++

#include <bits/stdc++.h>
using namespace std;

vector<vector<string> > orders;
vector<int> lists;
map<string,int> m;
map<string,int> bif;

bool is_inf = false;

std::vector<std::string> split(const std::string &str, char sep){
    std::vector<std::string> v;
    std::stringstream ss(str);
    std::string buffer;
    while( std::getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

bool ADD(vector<string> vec,bool is_halt){

    m[vec[1]] = m[vec[1]];

    int con;

    if(isdigit(vec[3])){
        stringstream ss;
        ss << vec[3];
        ss >> con;
        if(m[vec[2]] + con < 16 && m[vec[2]] + con >= 0 && !is_halt) {
            m[vec[1]] = m[vec[2]] + con;
        }
        else{
            return false;
        }
    }
    else{
        if(m[vec[2]] + m[vec[3]] < 16 && m[vec[2]] + m[vec[3]] >= 0 && !is_halt) {
            m[vec[1]] = m[vec[2]] + m[vec[3]];
        }
        else{
            return false;
        }
    }

    return true;

}

bool SUB(vector<string> vec,bool is_halt){

    m[vec[1]] = m[vec[1]];

    int con;

    if(isdigit(vec[3])){
        stringstream ss;
        ss << vec[3];
        ss >> con;
        if(m[vec[2]] - con >= 0 && !is_halt) {
            m[vec[1]] = m[vec[2]] - con;
        }
        else{
            return false;
        }
    }
    else{
        if(m[vec[2]] - m[vec[3]] >= 0 && !is_halt) {
            m[vec[1]] = m[vec[2]] - m[vec[3]];
        }
        else{
            return false;
        }
    }

    return true;
}

bool SET(vector<string> vec,bool is_halt){

    m[vec[1]] = m[vec[1]];

    int con;

    if(isdigit(vec[2])){
        stringstream ss;
        ss << vec[2];
        ss >> con;

        if(con >= 0 && con < 16 && !is_halt) {
            m[vec[1]] = con;
        }
        else{
            return false;
        }
    }
    else{
        if(m[vec[2]] >= 0 && m[vec[2]] < 16 && !is_halt) {
            m[vec[1]] = m[vec[2]];
        }
        else{
            return false;
        }
    }
    return true;
}

bool IF(vector<string> vec,bool is_halt){

    if(m[vec[1]] == 0){
        return false;
    }

    int dest;

    stringstream ss;

    ss << vec[2];
    ss >> dest;

    int index = 0;
    lists.push_back(dest);


    while(1){
        if(lists[index] == dest){
            break;
        }
        index++;
    }

    lists.pop_back();

    if(index == lists.size()){
        return false;
    }

    bif[vec[1]] = m[vec[1]];//if?????????????????????

    int stopline = lists.size()-1;

    while(stopline != index){
        if(orders[index][0][0] == 'A'){//ADD
            if(!ADD(orders[index],is_halt)){
                is_halt = true;
            }
        }
        else if(orders[index][0][0] == 'S' && orders[index][0][1] == 'U'){//SUB
            if(!SUB(orders[index],is_halt)){
                is_halt = true;
            }
        }
        else if(orders[index][0][0] == 'S' && orders[index][0][1] == 'E'){//SET
            if(!SET(orders[index],is_halt)){
                is_halt = true;
            }
        }
        else if(orders[index][0][0] == 'I'){//IF
            if(!IF(orders[index],is_halt)){
                is_halt = true;
            }
        }
        index++;
    }

    if(bif[vec[1]] == m[vec[1]]){
        is_inf = true;
    }
    else{
        IF(vec,is_halt);
    }

    return true;

}

int main() {

    int n;

    cin >> n;

    cin.ignore();

    bool is_halt = false;

    while(n--){
        int line;
        cin >> line;
        cin.ignore();
        string s;
        getline(cin,s);

        vector<string> vec;
        vec = split(s,' ');
        lists.push_back(line);
        orders.push_back(vec);

        if(s[0] == 'A'){//ADD
            if(!ADD(vec,is_halt)){
                is_halt = true;
            }
        }
        else if(s[0] == 'S' && s[1] == 'U'){//SUB
            if(!SUB(vec,is_halt)){
                is_halt = true;
            }
        }
        else if(s[0] == 'S' && s[1] == 'E'){//SET
            if(!SET(vec,is_halt)){
                is_halt = true;
            }
        }
        else if(s[0] == 'I'){//IF
            if(!IF(vec,is_halt)){
                is_halt = true;
            }
            if(is_inf){
                cout << "inf" << endl;
                return 0;
            }
        }
        else{//HALT
            is_halt = true;
        }
    }

    for(map<string,int>::iterator itr = m.begin(); itr != m.end(); itr++){
        cout << itr->first << "=" << itr->second << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'bool ADD(std::vector<std::__cxx11::basic_string<char> >, bool)':
a.cc:27:15: error: no matching function for call to 'isdigit(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   27 |     if(isdigit(vec[3])){
      |        ~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/istream:40,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/bits/locale_facets.h:2649:5: note: candidate: 'template<class _CharT> bool std::isdigit(_CharT, const locale&)'
 2649 |     isdigit(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2649:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:35:
/usr/include/ctype.h:111:1: note: candidate: 'int isdigit(int)'
  111 | __exctype (isdigit);
      | ^~~~~~~~~
/usr/include/ctype.h:111:1: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  111 | __exctype (isdigit);
      | ^~~~~~~~~
a.cc: In function 'bool SUB(std::vector<std::__cxx11::basic_string<char> >, bool)':
a.cc:57:15: error: no matching function for call to 'isdigit(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   57 |     if(isdigit(vec[3])){
      |        ~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2649:5: note: candidate: 'template<class _CharT> bool std::isdigit(_CharT, const locale&)'
 2649 |     isdigit(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2649:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:111:1: note: candidate: 'int isdigit(int)'
  111 | __exctype (isdigit);
      | ^~~~~~~~~
/usr/include/ctype.h:111:1: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  111 | __exctype (isdigit);
      | ^~~~~~~~~
a.cc: In function 'bool SET(std::vector<std::__cxx11::basic_string<char> >, bool)':
a.cc:86:15: error: no matching function for call to 'isdigit(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   86 |     if(isdigit(vec[2])){
      |        ~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2649:5: note: candidate: 'template<class _CharT> bool std::isdigit(_CharT, const locale&)'
 2649 |     isdigit(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2649:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:111:1: note: candidate: 'int isdigit(int)'
  111 | __exctype (isdigit);
      | ^~~~~~~~~
/usr/include/ctype.h:111:1: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  111 | __exctype (isdigit);
      | ^~~~~~~~~