随笔分类 -  C/C++

摘要:通过cmd启动程序并传递参数的方法 C++ test.exe aaa bbb ccc C++ test.exe aaa bbb ccc 阅读全文
posted @ 2019-09-20 13:44 test1024 阅读(1307) 评论(0) 推荐(0)
摘要:头文件 读取代码段 使用 ifstream 然后对C++进行文件的读取 C++ int main() { string filepath = "test.txt"; //ofstream myfile("test.txt"); ofstream myfile(filepath.c_str()); m 阅读全文
posted @ 2019-09-18 09:44 test1024 阅读(154) 评论(0) 推荐(0)
摘要:set insert到容器中后自动从小到大排序 元素不会重复插入 输出用迭代器 正向iterator 反向reverse_iterator it, s.begin(), s.end() 均为地址 输出加* 1 插入 s.insert(); 2 获得当前元素个数 s.size(); 3 查找set中元 阅读全文
posted @ 2018-10-18 11:33 test1024 阅读(125) 评论(0) 推荐(0)
摘要:使学号和成绩关联,然后成绩sort,学号也跟着改变。 代码: #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int MaxN = 1e5; struc 阅读全文
posted @ 2018-03-30 17:05 test1024 阅读(233) 评论(0) 推荐(0)