✔ 最佳答案
If you do not have to use stacks to do, here's an example of complete code:
http://hk.knowledge.yahoo.com/question/question?qid=7008040501636
If you have to use stacks, and still haven't mastered how to do it, PM me.
2008-04-21 03:33:09 補充:
I have written a program using gets() and manipulation of a character string to do just what you need. The source is a little long to be presented here, but is available under the heading of this question at:
http://mathmate.brinkster.net/programming.htm