9
25
2015
0

C++的unique函数


话说,C++中有一个unique函数用来去重。

今天,发现unique还有更高级的用法——通过函数自定义如何去重。下面是一个例子。

读入一个字符串,去掉重复且连续的空格再输出。比如,输入"abc    def g        hi",输出的就是"abc def g hi"。

这其实是我刚刚喷过的NOI题库中的一道题。。

Category: C++ | Tags: | Read Count: 352

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com