随笔 - 272  文章 - 0  评论 - 283  阅读 - 142万
  2012年10月18日
摘要: STL的find_if函数功能很强大,可以使用输入的函数替代等于操作符执行查找功能(这个网上有很多资料,我这里就不多说了)。比如查找一个数组中的奇数,可以用如下代码完成(具体参考这里:http://www.cplusplus.com/reference/algorithm/find_if/):#include <iostream>#include <algorithm>#include <vector>using namespace std;bool IsOdd (int i) { return ((i%2)==1);}int main () { vecto 阅读全文
posted @ 2012-10-18 21:17 Mike_Zhang 阅读(2158) 评论(5) 推荐(2) 编辑
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示