摘要: C++17将文件系统的操作封装了进来,从而可以跨平台的操作文件系统: #include <iostream> #include <fstream> #include <cstdlib> #include <filesystem> using namespace std::filesystem; in 阅读全文
posted @ 2022-07-13 20:20 萧海~ 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 给你一个以行程长度编码压缩的整数列表 nums 。 考虑每对相邻的两个元素 [freq, val] = [nums[2i], nums[2i+1]] (其中 i >= 0 ),每一对都表示解压后子列表中有 freq 个值为 val 的元素,你需要从左到右连接所有子列表以生成解压后的列表。 请你返回解 阅读全文
posted @ 2022-07-13 19:57 萧海~ 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 传统上C++是通过拷贝构造函数完成通过一个对象初始化另一个对象: class A{ public: A() { m_i = new int(1); cout<<"Construct A, this addr:"<<this<<", m_i addr:"<<m_i<<endl; } A(const A 阅读全文
posted @ 2022-07-13 14:45 萧海~ 阅读(200) 评论(0) 推荐(0) 编辑