C++研究

C++细节深度探索及软件工程

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  37 随笔 :: 0 文章 :: 74 评论 :: 0 Trackbacks

/********************************************************************
 created: 2007/04/18
 created: 18:4:2007   0:40
 filename:  C:\testvc6\TestStll\TestStll.cpp
 file path: C:\testvc6\TestStll
 file base: TestStll
 file ext: cpp
 author:  chang xinglong(King.C)
 
 purpose: STL visit Console For output
*********************************************************************/

 1#include <iostream>
 2#include <vector>
 3#include <algorithm>
 4using namespace std;
 5int main()
 6{
 7vector<int> coll;
 8//insert elements from 1 to 9
 9for (int i=1; i<=9++i) {
10coll.push_back(i);
11}

12//print all element in reverse order
13copy (coll.begin(), coll.end(), //source
14ostream_iterator<int> (cout,"\n")); //destination
15cout << endl;
16return 0;
17}
 
posted on 2007-04-18 00:43 常兴龙 阅读(151) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


> hi的博客