Nov 15

贴一个很ooxx的STL代码。。。 不指定

felix021 @ 2008-11-15 04:50 [IT » 程序设计] 评论(1) , 引用(0) , 阅读(5697) | Via 本站原创 | |
#include<iostream>
#include<vector>
#include<iterator>
#include<algorithm>
using namespace std;

int main(){
    vector<int>a;
    copy(istream_iterator<int>(cin), istream_iterator<int>(), back_inserter(a));
    sort(a.begin(), a.end());
    copy(a.begin(), a.end(), ostream_iterator<int>(cout, " "));
    return 0;
}




欢迎扫码关注:




转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php
slyar Email Homepage
2008-11-17 12:02
我看看,我认识copy,sort.....
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   *非必须
网址   电邮   [注册]