// rotate algorithm example
#include <iostream> // cout
#include <algorithm> // rotate
#include <vector> // vector
using namespace std;
int main () {
vector<int> myvector; // set some values:
for (int i=; i<; ++i) myvector.push_back(i); // 1 2 3 4 5 6 7 8 9 rotate(myvector.begin(),myvector.begin()+,myvector.end());
// 4 5 6 7 8 9 1 2 3
// print out content:
cout << "myvector contains:";
for (vector<int>::iterator it=myvector.begin(); it!=myvector.end(); ++it)
cout << ' ' << *it;
cout << '\n'; return ;
}

输出

myvector contains:         

最新文章

  1. 有关对字符串的处理,需要用到List时的简化写法
  2. Pinyin4Net
  3. jsp或Action获取请求参数中文乱码
  4. POJ 3107 Godfather (树形dp)
  5. 【SVN Working copy is too old (format 10, created by Subversion 1.6)】解决方式
  6. 关于php输入$_post[‘’]报错的原因
  7. C嵌入汇编
  8. jquery表格datagrid单元格显示图片及分页使用
  9. everything of people’s life can changed in their twenties
  10. 《java入门第一季》之类StringBuffer类初步
  11. Percona-Toolkit 之 pt-online-schema-change 总结
  12. 通用网关接口 ruby perl web页面 文本处理 脚本语言
  13. python 拷贝文件
  14. Android混合式开发(Hybrid)
  15. 【Cf #291 B】R2D2 and Droid Army(二分,线段树)
  16. C++中前置声明的应用与陷阱
  17. ARP协议相关介绍
  18. s3cmd : Add a config parameter to enable path-style bucket access 当ceph rgw使用域名时,需要支持 path-style bucket特性
  19. 16位模式/32位模式下PUSH指令探究——《x86汇编语言:从实模式到保护模式》读书笔记16
  20. SQL Server -&gt;&gt; 高可用与灾难恢复(HADR)技术 -- AlwaysOn(实战篇)之建立活动目录域、DNS服务器和Windows故障转移群集(准备工作)

热门文章

  1. (六)CXF之自定义拦截器
  2. Spring基础篇——DI/IOC和AOP原理初识
  3. freemarker循环、下标及判断
  4. Spring Boot实现自定义注解
  5. log4j日志properties配置
  6. LAMP源码编译安装
  7. Nginx 的关键组件的介绍
  8. VMware Workstation 14 安装使用 (小白安装使用教程)
  9. doesn&#39;t declare an explicit app_label and isn&#39;t in an application in INSTALLED_APPS.
  10. CentOS6.9 Python环境配置(python2.7、pip、virtualenv)