Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){

    int score[200];
    fill(score,score+200,0);
    for(char ch = '2'; ch <= '9'; ch++)
        score[ch]=ch-'0';
    score['T']=score['J']=score['Q']=score['K']=10;
    score['A']=11;
    int n;
    cin>>n;
    while(n--){
        int aNum=0;
        int cs=0;
        for(int i = 0; i<2; i++){
            char ch;
            cin>>ch;
            if(ch=='A')
                aNum++;
            else
                cs+=score[ch];
        }
        string str;
        for(int i = 0; i < 8; i++){
            char ch;
            cin>>ch;
            str+=ch;
        }
        if(cs==10&&aNum==1){
            cout<<"blackjack"<<endl;
            continue;
        }
        else{
            if(cs>17){
                cout<<cs<<endl;
                continue;
            }
            bool b=false;
            bool ok=false;
            int fs=0;
            for(int i = 0; i < str.size(); i++){
                char ch=str[i];
                if(ch=='A')
                    aNum++;
                else
                    cs+=score[ch];
                // _Ì»è
                if(aNum==0){
                    if(cs>21){
                        //bust
                        b=true;
                        break;
                    }
                    if(cs>17){
                        //fin
                        fs=cs;
                        ok=true;
                        break;
                    }
                }
                else{
                    // AÍêÜÅ11ÆµÄg¤±ÆªÂ\
                    for(int j = 0; j <= 1; j++){
                        int ccs=(cs+j*11+(aNum-j));
                        // 1gp·éÆ«
                        if(j==1){
                            if(ccs-11==6){
                                break;
                            }
                            else{
                                if(ccs>21){
                                    b=true;
                                    break;
                                }
                                else{
                                    if(ccs>17){
                                        fs=ccs;
                                        ok=true;
                                        break;
                                    }
                                }
                            }
                        }
                        else{
                            if(ccs>21){
                                b=true;
                                break;
                            }
                            else{
                                if(ccs>17){
                                    ok=true;
                                    fs=ccs;
                                    break;
                                }
                            }
                        }
                    }
                    if(b||ok){
                        break;
                    }
                }
            }
            if(b)
                cout<<"bust"<<endl;
            else
                cout<<fs<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:37: error: 'j' was not declared in this scope
   68 |                         int ccs=(cs+j*11+(aNum-j));
      |                                     ^
a.cc:107:16: error: 'b' was not declared in this scope
  107 |             if(b)
      |                ^
a.cc:110:23: error: 'fs' was not declared in this scope; did you mean 'cs'?
  110 |                 cout<<fs<<endl;
      |                       ^~
      |                       cs
a.cc: At global scope:
a.cc:113:5: error: expected unqualified-id before 'return'
  113 |     return 0;
      |     ^~~~~~
a.cc:114:1: error: expected declaration before '}' token
  114 | }
      | ^