博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
STL_inserts
阅读量:4340 次
发布时间:2019-06-07

本文共 706 字,大约阅读时间需要 2 分钟。

#include<iostream>

//#include<list.h>
#include<iterator>
#include<vector>
#include<string>
using namespace std;
void main()
{
    string s1[4]={"fine","fish","fashion","fate"};
    string s2[2]={"busy","bate"};
    string s3[3]={"silly","singers"};
    vector<string>word(4);
    copy(s1,s1+4,word.begin());
    ostream_iterator<string,char>out(cout,"\t");
    copy(word.begin(),word.end(),out);
    cout<<endl;
    copy(s2,s2+2,back_insert_iterator< vector<string> >(word));//<vector<string> (必须有一个空格)>
    copy(word.begin(),word.end(),out);
    cout<<endl;
    copy(s3,s3+2,insert_iterator <vector<string> >(word,word.begin()));
    copy(word.begin(),word.end(),out);
    cout<<endl;
    return;
}

转载于:https://www.cnblogs.com/hqu-ye/archive/2013/02/23/2923449.html

你可能感兴趣的文章
cordova开发---cordova环境搭建(windows pc)
查看>>
怎样使用Block来传递消息?
查看>>
好奇你就点进来
查看>>
Effective C++ 34 区分接口继承和实现继承
查看>>
Redis配置文件参数说明
查看>>
drf视图组件、认证组件
查看>>
Python_正则表达式
查看>>
[USACO08NOV]时间管理Time Management(排序,贪心)
查看>>
Hybrid App开发设计与实现
查看>>
Fedora14 mount出现错误时解决办法【亲测有效】
查看>>
实验四
查看>>
如何打开 SSH 服务?
查看>>
BASIC-6_蓝桥杯_杨辉三角形
查看>>
Objective-C 的动态提示和技巧
查看>>
Java 常用方法
查看>>
SQL的几种连接:内连接、外连接(左连接、右连接、全连接)
查看>>
IBM小型机维护
查看>>
The Garden Party -01
查看>>
【XLL 框架库函数】 TempActiveRef/TempActiveRef12
查看>>
【Excel】使用 Application 对象事件
查看>>