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;
}