09 2024 档案

摘要:修改字符串 //用sprintf把buffer字符串格式化 sprintf(buffer, "Age: %d, Height: %.1f", age, height); 从字符串读取数据 // 使用 sscanf 从字符串中读取数据 sscanf(data, "%d %lf", &age, &hei 阅读全文
posted @ 2024-09-26 18:13 某朝 阅读(8) 评论(0) 推荐(0) 编辑
摘要:例题深得我心 阅读全文
posted @ 2024-09-24 17:14 某朝 阅读(10) 评论(0) 推荐(0) 编辑
摘要:ds题目 #include<iostream> using namespace std; typedef struct Node { int index; int data; }node; const int N = 10010; node a[N]; int output[N]; int hh = 阅读全文
posted @ 2024-09-23 14:20 某朝 阅读(4) 评论(0) 推荐(0) 编辑
摘要:汉诺塔 逆序输出(栈先进后出) #include<iostream> #include<stack> #include<tuple> using namespace std; int n; const int N = 10010; stack <tuple<int, char, char, char 阅读全文
posted @ 2024-09-21 16:22 某朝 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <iomanip> #include <unordered_map> #include <string> using namespace std; const int N = 100010; unordered_map<string, str 阅读全文
posted @ 2024-09-17 11:34 某朝 阅读(39) 评论(0) 推荐(0) 编辑
摘要:append:附加 ls:列出目录内容。 cd:更改当前目录。 pwd:显示当前位置的路径。 cp:复制文件或目录。 mv:移动或重命名文件或目录。 rm:删除文件或目录。 mkdir:创建新目录。 rmdir:删除空目录。 chmod:更改文件或目录的权限。 chown:更改文件或目录的所有者。 阅读全文
posted @ 2024-09-09 14:45 某朝 阅读(29) 评论(0) 推荐(0) 编辑
摘要:推断二叉树 已知前序中序求后序 #include<cstring> #include<cstdio> #include<iostream> using namespace std; void binary_tree(string mid, string pre) { if (mid.size() > 阅读全文
posted @ 2024-09-03 17:23 某朝 阅读(15) 评论(0) 推荐(0) 编辑
摘要:先序遍历 using namespace std; // 定义二叉树节点结构体 struct TreeNode { char Data; // 节点的数据 TreeNode* left; // 左子节点 TreeNode* right; // 右子节点 // 构造函数 TreeNode(char d 阅读全文
posted @ 2024-09-02 10:16 某朝 阅读(26) 评论(0) 推荐(0) 编辑
摘要:自我赋值问题:函数意图是反转数组,但会覆盖原数组的内容。可以使用一个临时数组来解决。 void myConverse(int a[], int size) { int* temp = new int[size]; // 分配临时数组 for (int i = 0; i < size; i++) { 阅读全文
posted @ 2024-09-01 12:12 某朝 阅读(11) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示