随笔分类 -  C++

摘要:修改CMakeLists.txt内容 cmake_minimum_required(VERSION 3.23) project(test) set(CMAKE_CXX_STANDARD 14) #上面三行无需改动 #递归遍历所有的cpp文件 file (GLOB_RECURSE files *.cp 阅读全文
posted @ 2022-11-26 10:15 当惜 阅读(142) 评论(0) 推荐(0)
摘要:方向矩阵 // →为初始方向 int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; for (int i = 1, x = 0, y = 0, d = 0; i <= n * n; i ++ ) { res[x][y] = i; int a = x + dx 阅读全文
posted @ 2022-10-25 10:11 当惜 阅读(25) 评论(0) 推荐(0)
摘要:基础 //ASCII 'A':65 'Z':90 'a':97 'z':122 '0':48 常见函数 abs() reverse(a, a + n) //#include<algorithm> memset(a, 0, sizeof a) //#include<cstring> memcpy(b, 阅读全文
posted @ 2022-03-20 11:20 当惜 阅读(139) 评论(0) 推荐(0)