前言:C++与python刷题的不同实现 c++ string类型的使用以及定义数组 注:string常用方法后面补充 string array[3]; 交换元素 c++ vector<int>& output; swap(output[0], output[1]); python x ,y = y, x 复制数组或列表 python nums = [1, 2, 3] nums_copy = nums[:]