01 2023 档案
摘要:string类型 string s; s.erase(pos, len); //从pos位置开始,往后面删除len个字符,返回值是修改后的string iterator erase(iterator p); s.erase(s.begin()); //删除该迭代器位置的字符,返回值是删除后的下一个字
阅读全文
摘要:vector<int> s(2, 1); auto [x, y] = s; //错误用法 pair<int, int> p{1,1}; auto [x, y] = p; //正确用法
阅读全文
摘要:先附上链接 sheepcode 在C++中的用法 为什么使用双反斜杠:因为d表示d这个字符,\d表示所有数字,而要表示\d,就要表示\,所以要用一个反斜杠来转义\,于是形成\d 例题 Leecode.65 class Solution { public boolean isNumber(String
阅读全文
摘要:eg1: Leecode class Solution { public: int maxHappyGroups(int batchSize, vector<int>& groups) { w = groups; n = w.size(); m = batchSize; ans = 0; for(i
阅读全文