摘要: 按单词逆序字符串(以空格分隔),使用栈实现。 1 #include <iostream> 2 #include <stack> 3 #include <cstring> 4 5 void printStack(stack<char> *s) 6 { 7 while (!s->empty()) 8 { 9 char c = s->top();10 printf("%c", c);11 s->pop();12 }13 }14 15 void reverseStringByWord(char *src)16 {17 阅读全文
posted @ 2011-09-20 15:10 虚怀.若谷 阅读(321) 评论(0) 推荐(0)