제가 자료구조를 공부중인데요^^;

palindrome을 구현하려고 합니다.

프롬프트가 떳을때 abccba를 입력한후 enter를 누르면   a,b,c,c,b,c,d 하나씩 끊어서 스택에 push를 하고 싶습니다.

그렇다면 입력을 받을때 어떤 방식으로 입력을 받아야 하나씩 끊어서 받을수 있을까요?

아래는 제가 스택을 구현해 놓은것 입니다.

#include <iostream.h>
#include <string.h>
#include <stdlib.h>


const int stackSize=20;

char stack[stackSize];
int top=0;
void stackCreate(),push(char num),display(),Delete(),pop();
int isFull(),isEmpty();

void main()
{
        char input;

        stackCreate();
        cin >> input; // input을 어떻게 받아야 될까요?? 한줄에 스티링으로 받으면 하나씩 끊어서 처리가 안될것 같고... 어떻게 해야되나요>
        push(input);
        pop();

}

void stackCreate()
{
        top=-1;
}

void push(char num){ top+=1; stack[top]=num; }

void pop()
{
        if(!isEmpty()){
                cout << stack[top] << " is poped" << endl;
        top-=1;
        }
        else cout << "stack is Empty" << endl;
}

void Delete()
{
        if(!isEmpty()){
                stack[top]=NULL;
        top-=1;
        }
        else cout << "stack is Empty" << endl;
}

void display()
{
        int sp;
        if(isEmpty())
                cout << "Stack is Empty" << endl;
        else{
                sp=top;
                while(sp !=-1){
                cout << stack[sp] << endl;
                sp--;
                }
        }
}

int isFull(){ if(top==stackSize-1) return 1; else return 0;}
int isEmpty(){ if(top==-1) return 1; else return 0;}