10 2023 档案
摘要:#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <random> #include "util.h" using namespace std; struct Point { in
阅读全文
摘要:基础的一个 cmake 文件: cmake_minimum_required(VERSION 3.25) set(CMAKE_CXX_STANDARD 20) project(app) # 可执行文件存储目录 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_
阅读全文
摘要:vim 清除当前行往下的所有空行:., /d :e 文件 编辑文件 如果想快速选中一个单词(此时光标可以在单词的任意一个位置),我们只需要在 normal 模式先按下vaw(连单词后面的空格也选中)或viw(不选中单词后面的空格) 同理,如果想快速删除一个单词并重新进入编辑模式,需要按
阅读全文
摘要:# If you come from bash you might have to change your HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. expor
阅读全文
摘要:debian 设置镜像源 在 /etc/apt/sources.list 下将原来的内容删去,然后改为如下内容(清华镜像源) deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-fre
阅读全文
摘要:参考:指针声明 常量指针 (Pointer to Constant) 定义:一个指向常量的指针。这意味着指针指向的值不能被修改,但指针本身可以被修改,即可以重新指向其他地址。 声明:const Type* pointerName; const int* p1; int x = 10, y = 20;
阅读全文
摘要:参考:默认实参 #include <iostream> void f(int a, int b = 1); // 只要前面声明了 b 的值,后面 b 可以不给默认值 void f(int a = 2, int b) { std::cout << a << ' ' << b << '\n'; } in
阅读全文
摘要:先在本地windows 环境下安装好 ssh,然后用 ssh-keygen -t rsa -C "xxx@xxx.com"生成密钥 在服务器上也使用ssh-keygen -t rsa -C "xxx@xxx.com"生成密钥 将本地的公钥传递到服务器:scp .\id_rsa.pub lc@47.1
阅读全文
摘要:#include <dirent.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #includ
阅读全文
摘要:#include <iostream> #include <string> class Token { public: Token() : tok(INT), ival(0) {} ~Token() { if (tok == STR) { sval.~basic_string(); // 联合体中编
阅读全文