void LineEdit(){
Stack S;
InitStack(S);
char ch;
printf("请输入...\n");
fflush(stdout);
ch = getchar();
while (ch != EOF){
while (ch != EOF && ch != '\n'){
ELEMTYPE e;
switch (ch){
case '#':
if (StackEmpty(S)){
printf("未输入任何字符.\n");
return;
}
Pop(S, e);
break;
case '@':
if (StackEmpty(S)){
printf("未输入任何字符.\n");
return;
}
ClearStack(S);
break;
default:
if (StackFull(S)){
printf("最多输入%d个字符\n", MAXSIZE);
return;
}
Push(S, ch);
break;
}
ch = getchar();
}
printStack(S);
fflush(stdout);
ClearStack(S);
if (ch != EOF)
ch = getchar();
}
ClearStack(S);
}
