15-04-02.cpp

来自「more efftive 代码」· C++ 代码 · 共 19 行

CPP
19
字号
#include <iostream>#include <functional>#include <algorithm>#include <cstdlib>#include <cstring>#include <cassert>using namespace std;int main(){  char str[] = "The first line\nThe second line";  int len = strlen(str);    const char* wptr = find_if(str, str + len,                             compose2(logical_or<bool>(),                                      bind2nd(equal_to<char>(), ' '),                                      bind2nd(equal_to<char>(), '\n')));  assert(wptr == str + len || *wptr == ' ' || *wptr == '\n');}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?