标题:C++问题如下:
只看楼主
daemon1
Rank: 1
等 级:新手上路
帖 子:72
专家分:3
注 册:2011-4-14
结帖率:80%
已结贴  问题点数:20 回复次数:1 
C++问题如下:
#include <iostream>
#include <algorithm>
#include <string>
#include <deque>
#include <stack>
#include <queue>
#include <utility>
#include <map>
#include <set>
#include <numeric>
#include <iterator>
using namespace std;

int main()

{
    istream_iterator<int> a(cin);
    istream_iterator<int> eof;
    vector<int>  kk(a,eof);//执行不了,为什么?编译器是:vc6.0!
    return 0;
}
搜索更多相关主题的帖子: return 编译器 
2011-06-11 23:09
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:507
帖 子:8890
专家分:53117
注 册:2011-1-18
得分:20 
#include <iostream>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    // 输入
    vector<int> kk( (istream_iterator<int>(cin)), istream_iterator<int>() );

    // 输出
    copy( kk.begin(), kk.end(), ostream_iterator<int>(cout," ") );

    return 0;
}

然后换个不那么烂得离谱的编译器,比如g++
2011-06-12 17:25



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-342546-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.131307 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved