0
点赞
收藏
分享

微信扫一扫

Windows与Linux的和谐共处时代!

左手梦圆 2024-08-21 阅读 4

记录一些C++比较好用的代码块,方便自个查看。

使用std::copy 快速打印序列

#include <iostream>
#include <algorithm>
#include <iterator>

int main()
{
    int a[5] = { 1, 2, 3, 4, 5 };
    copy(begin(a), end(a), ostream_iterator<int>(cout, " "));
    cout << endl;

    return 0;
}
举报

相关推荐

0 条评论