博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

test

Posted on 2012-07-24 17:15  紫冰龙  阅读(103)  评论(0编辑  收藏  举报
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	string str1("we are here!");
	string str2(str1);
	reverse(&str1[0],&str1[0]+12);
	cout <<str1<<endl;
	copy(&str1[0],&str1[0]+12,&str2[0]);
	cout <<str2<<endl;
	//reverse_copy(&str2[0],&str2[0]+12,ostream_iterator <char>(cout));
	cout <<str1<<endl;
	
}