06 2020 档案

摘要:输入 随机序列长度,返回 随机序列 int * randpermC(int N) { int *arr = (int*)malloc(N * sizeof(int)); int *arr2 = (int*)malloc(N * sizeof(int)); int count = 0; memset( 阅读全文
posted @ 2020-06-26 03:01 sbj123456789 阅读(544) 评论(0) 推荐(0) 编辑
摘要:C++读取csv文件,采用文件流的方法,用到了getline函数(带有自动分隔功能) #include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> using namespa 阅读全文
posted @ 2020-06-26 02:58 sbj123456789 阅读(5906) 评论(0) 推荐(0) 编辑
摘要:C++中string没有自带的split()函数,需要自己实现 void split(const string& s, vector<int>& sv, const char flag = ' ') { sv.clear(); istringstream iss(s); string temp; w 阅读全文
posted @ 2020-06-10 23:14 sbj123456789 阅读(1190) 评论(0) 推荐(0) 编辑
摘要:find()函数 参数:字符子串 返回:该子串第一个字母的下标位置,如果没找到则返回 string_name.npos position = memory_string.find("KB"); if (position != memory_string.npos) { return stoi(mem 阅读全文
posted @ 2020-06-10 23:04 sbj123456789 阅读(282) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示