函数对象(1)
来源:互联网 发布:js中字符串的方法 编辑:程序博客网 时间:2024/05/21 12:42
问题及代码:
#include <iostream>#include<vector>#include<iterator>#include<algorithm>#include<functional>using namespace std;int main(){ const int N=5; vector<int>s(N); for(int i=0;i<N;i++) cin>>s[i]; transform(s.begin(),s.end(),ostream_iterator<int>(cout," "),negate<int>()); cout<<endl; return 0;}
运行结果:
知识点总结:
函数对象有三种形式,这是第一种。
学习心得:
0 0
- 函数对象(1)
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 对象 函数
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象
- 函数对象~
- win7 64b下vmware虚拟机ubuntu14.04磁盘扩容
- Laravel系列之新建laravel项目(二)
- 这几天没有去学习
- 手工AD Safe去广告教程
- Redis数据类型和常用命令
- 函数对象(1)
- STL源码剖析——空间配置器
- linux /etc/security/limits.conf的相关说明
- create table用圆括号()
- java基础之数组
- JSP第一篇
- Swift语言中的枚举和结构体
- Mybatis的增删改查
- suppose如何用