usage of algorithm
来源:互联网 发布:网络直播运行模式 编辑:程序博客网 时间:2024/06/02 05:32
# include <iostream># include <cstdlib># include <vector># include <algorithm> // for_each()using namespace std;// 回调函数void current(int& v){cout << v << endl;}void print(vector<int> vec){cout << "The Elements are : " << endl;for_each(vec.begin(), vec.end(), current); // 遍历算法 遍历打印 current 回调函数}int compare(int& a, int& b){return a < b; // 从小到达 如果 A < B就可以}int main(){vector<int> v(10);for(int i=9; i>=0; i--){v[9-i] = i;}print(v);sort(v.begin(), v.end(), compare); // 排序的算法 compare 回调函数print(v);return 0;}
0 0
- usage of algorithm
- Usage of Pseudocode
- Usage of MFC CRectTracker
- Usage of awk
- effective usage of strtok
- Usage of Protocol Buffer
- Usage of pmake
- Usage sample of SSL
- usage of >>>、>> and << operators
- Extensive usage of Make
- Usage of Oracle Block
- Usage of TKPROF
- Usage of Ftp
- Usage of Func delegate
- Usage of Vmstat
- Usage Of TRCA
- Usage of #pragma
- The usage of finalize()
- Android 常用 mimeType 表及用法
- 正则表达式
- iOS开发问题----去掉输入键盘上的自动联想部分,限制长度内容,以及禁止输入emoji表情等问题
- mysql 变更数据库路径(linux)
- 制作证书的keytool工具用法总结
- usage of algorithm
- div垂直居中问题
- php企业号支付(微信支付)
- H含金量 iOS绘图及贝塞尔曲线关键知识
- java 利用反射 获取系统属性
- tomcat指定jdk版本
- C语言学习笔记之文件的分割与合并
- 提高项目24-删除数组元素
- java中使用正则表达式