posts - 297,  comments - 15,  trackbacks - 0
#include <iostream>
#include <fstream>
#include <vector>
#include <iterator>

using namespace std;

int main( int argc, char **argv )
{
        vector<int> v;
        ifstream in("1.txt");
        if (in) {
                copy(istream_iterator<int>(in), istream_iterator<int>(), back_inserter(v));
                copy(v.begin(), v.end(), ostream_iterator<int>(cout, " "));
                /*
                for (int i = 0; i < v.size(); i++) {
                        cout << v[i] << " ";
                }
                */
        }
    return 0;
}

from:
http://bbs.chinaunix.net/viewthread.php?tid=1218395

posted on 2010-02-25 08:58 chatler 阅读(600) 评论(0)  编辑 收藏 引用 所属分类: C++_BASIS

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


<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(10)

随笔分类(307)

随笔档案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感觉这个博客还是不错,虽然做的东西和我不大相关,觉得看看还是有好处的

network

OSS

  • Google Android
  • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
  • os161 file list

overall

搜索

  •  

最新评论

阅读排行榜

评论排行榜