- 博客(92)
- 收藏
- 关注

原创 利用Visual Studio将C++项目打包成DLL文件
静态链接库(Lib)与动态链接库(DLL)如果出于某种原因,不想将源代码暴露给别人,就需要使用到库。库有动态链接库和静态链接库。静态连接库就是把(lib)文件中用到的函数代码直接链接进目标程序,程序运行的时候不再需要其它的库文件。动态链接就是把调用的函数所在文件模块(DLL)和调用函数在文件中的位置等信息链接进目标程序,程序运行的时候再从DLL中寻找相应函数代码,因此需要相应DLL文件的支持。
2022-03-11 22:27:09
15845
4
原创 Leetcode 78. 子集 && 90. 子集 II
给你一个整数数组 nums ,数组中的元素 互不相同 。返回该数组所有可能的子集(幂集)。解集 不能 包含重复的子集。你可以按 任意顺序 返回解集。
2022-11-04 21:44:36
138
原创 Leetcode 39. 组合总和
给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target ,找出 candidates 中可以使数字和为目标数 target 的 所有 不同组合 ,并以列表形式返回。你可以按 任意顺序 返回这些组合。candidates 中的 同一个 数字可以 无限制重复被选取 。如果至少一个数字的被选数量不同,则两种组合是不同的。 对于给定的输入,保证和为 target 的不同组合数少于 150 个。
2022-11-04 17:11:26
95
原创 Leetcode 17. 电话号码的字母组合
给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合。答案可以按 任意顺序 返回。给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。
2022-11-02 01:07:08
136
原创 Leetcode 2. 两数相加
给你两个 非空 的链表,表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的,并且每个节点只能存储 一位 数字。请你将两个数相加,并以相同形式返回一个表示和的链表。你可以假设除了数字 0 之外,这两个数都不会以 0 开头。
2022-10-31 22:14:28
103
原创 Leetcode 104. 二叉树的最大深度
给定一个二叉树,找出其最大深度。二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。说明: 叶子节点是指没有子节点的节点。
2022-10-31 11:25:18
70
原创 HJ20 密码验证合格程序
代码#include <iostream>#include <string>using namespace std;bool check_char(string str) { // 核对大小写、数字、符号 int cate1 = 0, cate2 = 0, cate3 = 0, cate4 = 0; for (int i = 0; i < str.size(); i++) { if ( str[i] >= 'A' &a.
2022-05-27 22:18:50
96
原创 HJ15 求int型正整数在内存中存储时1的个数
代码#include <iostream>using namespace std;int main() { int num; while (cin >> num) { int m = 0; while (num) { m += num % 2; num /= 2; } cout << m << endl; }.
2022-05-27 17:35:21
80
原创 HJ12 字符串反转
代码#include <iostream>#include <string>#include <algorithm>#include <stack>using namespace std;int main() { string s; while (getline(cin, s)) {// reverse(s.begin(), s.end());// cout << s <&l.
2022-05-27 14:58:34
106
原创 HJ10 字符个数统计
哈希#include <iostream>#include <unordered_map>using namespace std;int main() { string str; while (cin >> str) { unordered_map<char, int> hash; for (auto ch : str) { if (hash.count(ch) == 0).
2022-05-19 20:41:48
123
原创 HJ8 合并表记录
哈希#include <iostream>#include <map>#include <unordered_map>using namespace std;int main() { int n; while (cin >> n) { map<int, int> tmp_map; for (int i = 0; i < n; i++) { int a, b.
2022-05-19 20:18:08
115
原创 HJ6 质数因子
#include <iostream>#include <math.h>using namespace std;int main() { int num; while (cin >> num) { int max = sqrt(num); for (int i = 2; i <= max; i++) { while (num % i == 0) { c.
2022-05-19 20:16:25
106
原创 HJ6 质数因子
#include <iostream>#include <math.h>using namespace std;int main() { int num; while (cin >> num) { int max = sqrt(num); for (int i = 2; i <= max; i++) { while (num % i == 0) { c.
2022-05-19 16:39:01
89
原创 HJ5 进制转换
#include <iostream>#include <string>#include <math.h>using namespace std;int main() { string s; while (cin >> s) { int bit = 0; int ans = 0; for (int i = s.size() - 1; i > 1; i--) { .
2022-05-19 16:10:26
175
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人