ostream_iterator

  #include <iostream>
  #include
<iterator>
  #include
<algorithm>
  
using namespace std ;  

  ostream_iterator output(cout,
" ") ; // 关联cout,设置分隔符
  copy(vec.begin(), vec.end(), output) ;  // 元素拷贝到ostream_iterator所指向的对象cout
cout <<endl ; // 别忘了加一个换行
posted @ 2011-04-27 09:52  walfud  阅读(777)  评论(0编辑  收藏  举报