摘要:
使用库函数 C++ //使用库函数 include include include using namespace std; int main() { string str; cin str; //调用reverse函数进行反转 reverse(str.begin(), str.end()); co 阅读全文
摘要:
归纳总结 这个表格总结了各种排序算法的复杂度与稳定性: 下面是关于相关排序的代码实现。 冒泡排序 C++ include using namespace std; void bubbleSort(int a[], int len) { int i, j, t; //将最小的先放到第一个位置 for 阅读全文
摘要:
C++ 风格的复制操作 使用STL中的copy算法 C++ int a[] = {1,2,3,4,5}; int b[5]; std::copy(std::begin(a),std::end(a),std::begin(b)); for(auto e:b) cout arr = {1,2,3,4,5 阅读全文