摘要: 写了两个函数,分别借助不同的函数实现,代码的逻辑很简单:#include #include #include //strtok #include #include using namespace std; //实现将一个字符串按照分隔符划分成单词 /* *思路: *每一个单词的开头也就是第一个非空格的位置,用start = find_first_not_of(' ', end)来得到 *每一个单词的结尾就是从start开始的第一个空格的前一个位置用end = find_first(' ', start)来得到 */ vector split(const stri 阅读全文
posted @ 2013-06-27 09:11 dancingrain 阅读(414) 评论(0) 推荐(0) 编辑