Stacks reverse question

pls tell my code is working on codeblocks but it doesnt give output in hackerblocks also its show run time error so correct my code
#include
#include
using namespace std;

void transfer(stack &s1,stack &s2, int num){
for (int i = 0; i < num; i++)
{
s2.push(s1.top());

	s1.pop();
	}

}

void reverseStack(stack &st){

stack<char> st_helper;
int n = st.size();
for (int i = 0; i < n; i++)	{

	char top_member = st.top();

	st.pop();

	int left_members = n - 1 - i;

	transfer(st, st_helper, left_members);

	st.push(top_member);

	transfer(st_helper, st, left_members);

}

}

int main(int argc, char const *argv[]){

int n;
cin>>n;

stack<char> st;
while(n--){
    char a;
    cin>>a;
    st.push(a);
}

if(n!=0){
reverseStack(st);
while(n–){
cout<<st.top()<<endl;
st.pop();
}

}

return 0;

}

hey @kshitiz.gzb, please share the code saved in Coding blocks ide beacause text gets mismatched here.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.