摘要: 昏了头,这竟然忘了,纠错搞了半天。 const int N = 10; int a [N]; //这是对的,因为const指定为常量 const int N = 10; int M = 2 * N; int a[M]; //这是错的,因为M为变量。 阅读全文
posted @ 2023-10-21 21:44 Geni_w 阅读(20) 评论(0) 推荐(0) 编辑
摘要: `iomanip`是C++标准库中提供了对输入输出流的输入输出格式进行控制的头文件。它定义了一些操纵符(manipulator),可以用于设置输出流的格式。 阅读全文
posted @ 2023-07-02 12:42 Geni_w 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 没想到再次回顾快排发现自己对于快排的理解还不是很深入。 这是Acwing中模板题 快排的时间复杂度为O(nlogn) ~ O(n^2); 若用《数据结构(C语言版)》中的算法: 【代码解析】 void Quick_Sort(int *arr, int begin, int end){ if(begi 阅读全文
posted @ 2023-07-01 17:11 Geni_w 阅读(9) 评论(0) 推荐(0) 编辑