摘要: 1.使用算法头文件中的reserve #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string s = "hello"; reverse(s.begin(), 阅读全文
posted @ 2021-07-08 00:24 nanfengnan 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1.采用C++的vector定义二维数 int main() { //matrix.size(); 二维数组有多少行 //matrix[i].size(); 每行有多少列 vector< vector<int> > matrix(3); //vector创建二维数组,多少行 for (int i = 阅读全文
posted @ 2021-07-08 00:07 nanfengnan 阅读(738) 评论(0) 推荐(0) 编辑