摘要: 学习资料 1.B02 图的存储 2.图是如何存储的:BFS、DFS 各种存图方式的区别 图片来自上述学习资料 这里主要推荐表格中的后两种存图方法,因为适用于各种图。 只有在需要对一个点的所有出边进行排序的场合下,使用vector存边排序更方便,其余情况vector存边与链式前向星功能一样。 vect 阅读全文 »
posted @ 2025-02-12 10:42 Tshaxz 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 关键函数 insert(pos,length, ch) string num = to_string(i); num.insert(0, 4 - num.size(), '0'); 例题:猜数字 样例1 输入 6 4815 1A1B 5716 0A1B 7842 0A1B 4901 0A0B 858 阅读全文 »
posted @ 2025-02-10 17:21 Tshaxz 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 学习资料 1.https://www.bilibili.com/video/BV1Ki4y1x7Lm 1.函数对比 前序中序推后序 void dfs(string mid, string pre) { if (mid.size()) { char root = pre[0]; int cur = m 阅读全文 »
posted @ 2025-02-10 10:15 Tshaxz 阅读(1) 评论(0) 推荐(0) 编辑
摘要: stod函数 将string转为double string t = s.substr(i, j - i); double num = stod(t); 例题:货币单位换算 样例1 输入 2 20CNY53fen 53HKD87cents 输出 6432 说明: 20元53分+53港元87港分,换算成 阅读全文 »
posted @ 2025-02-09 18:24 Tshaxz 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 单个char转string char x = 'a'; string c = string(1, x); string转单个char string s = "abc"; char x = s[0]; string转char[](字符数组) string s = "abc"; s.c_str(); ( 阅读全文 »
posted @ 2025-02-08 20:48 Tshaxz 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 头文件: #include <cstring> #include <sstream> 题目未给定数据个数,一般多在模拟题用到 string str; getchar(); //如果getline()之前已经读入过其他数据,需要用getchar()读掉前面剩下的回车 getline(cin, str) 阅读全文 »
posted @ 2025-02-07 17:28 Tshaxz 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 读取时间 HH:MM:SS:NN型 函数 //转为毫秒表示,方便比大小 int get(string time) { int h, m, s, ms; //从字符串内读数据 sscanf(time.c_str(), "%d:%d:%d.%d", &h, &m, &s, &ms); return h 阅读全文 »
posted @ 2025-02-07 17:24 Tshaxz 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 已知正方形相邻两点(a,b) or (x1, y1)与(c,d) or (x2, y2)坐标 公式: \( (x_3,y_3) = (c + (b-d), d - (a-c)) \\ (x_4,y_4) = (a + (b-d), b - (a-c)) \\ (x_5,y_5) = (a - (b- 阅读全文 »
posted @ 2025-02-01 00:10 Tshaxz 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 示例:给出一行用逗号隔开的数字,要求把这串数组存到数组a中 21,30,62,5,31 写法一:双指针写法 int n = 0; int a[N]; void getnum(string &s) { for (int i = 0; i < s.size(); i++) { int j = i, nu 阅读全文 »
posted @ 2025-01-31 15:39 Tshaxz 阅读(2) 评论(0) 推荐(0) 编辑
摘要: IDM官网 破解脚本 密码:6eqa 阅读全文 »
posted @ 2025-01-30 00:52 Tshaxz 阅读(6) 评论(0) 推荐(0) 编辑
Language: HTML
点击右上角即可分享
微信分享提示