在调试的时候,这一步有什么问题吗?

这是题目:我还没完全写完

img


这是错误:

img


#include<iostream>
#include<stack>
#include<string>
#include<queue>
using namespace std;
int main(){
    string s1,s2,s3;//s3为储存数组. 3为1-3,2为1-2,1为3-2 
//    s3=
    cin>>s1;
    cin>>s2;
    queue<char>a1;
    queue<char>a2;
    stack<char>a3;
    char flag='T';
    for(int i=0;i<s1.length();i++)
        a1.push(s1[i]);
    for(int i=0;i<s2.length();i++)
        a2.push(s2[i]);
    while(!a1.empty()){
        if(a1.front()==a2.front()){
            a1.pop();
            a2.pop();
            s3+="2";    
        }
        else{
            while(a3.top()==a2.front()&&!a3.empty()&&!a2.empty()){
                a3.pop();
                a2.pop();
                s3+="1";
            }
            a3.push(a1.front());
            if(!a1.empty())
                a1.pop();
            s3+="3";
        }
    }
    for(int i=0;i<s3.length();i++){
        if(s3[i]=='1'){
            cout<<"3->2"<<endl;
        }
        else if(s3[i]=='2'){
            cout<<"1->2"<<endl;
        }
        else if(s3[i]=='3'){
            cout<<"1->3"<<endl;
        }
    }
    
    
} 

//ABC
//CBA
//1->3
//1->3
//1->2
//3->2
//3->2