Stack error.

0

Witam napisalam dzis kod tego typu, kopiluje sie jednak po wpisuaniu liczby testow i wprowadzeniu pierwszego wyskakuje error : "deque iterator not dereferencable" czy wie ktos moze gdzie jest blad? oto kod

 #include <iostream>
#include <stack>
#include <string>
 
using namespace std;
 

 
int main()
{
        stack < char > s;
		//s.empty();
        int t;
        cin>>t;
        
        for(int j=0; j<t;j++) {
				string in;
				int size;
				size=in.length();
				getline(cin, in);
				cin.ignore(1);
                for(int i= size-1; i>= 0 ; i--) {
                        char arg1, arg2;
                       
						if(in[i] == 't'){
							s.push('t');
						}
						if(in[i] == 'f'){
							s.push('f');
						}
						if(in[i] == 'K'){
							arg1 = s.top();
							s.pop();
							arg2 = s.top();
							s.pop();
							s.push(arg1+arg2+'K');		
						}
						if(in[i] == 'A'){
							arg1 = s.top();
                            s.pop();
                            arg2 = s.top();
                            s.pop();
                            s.push(arg1+arg2+'A');
						}
						if(in[i] == 'N'){
							arg1 = s.top();
                            s.pop();
                            s.push(arg1+'N');
						}
						
						
						
				}
			//s.empty();
               cout<<s.top()<<endl;
               s.pop();
        }
 
        return 0;
}
0
                string in;  // pusta zmienna
                int size;
                size=in.length(); // size=0;
                getline(cin, in);
                cin.ignore(1);
                for(int i= size-1; i>= 0 ; i--) { // i zaczyna od -1

1 użytkowników online, w tym zalogowanych: 0, gości: 1