摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu 阅读全文
posted @ 2023-05-09 19:40 Hbro 阅读(13) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-05-08 19:06 Hbro 阅读(14) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-05-05 20:26 Hbro 阅读(5) 评论(0) 推荐(0)
摘要: 1.设置开始的窗口长度为1,最大长度为0如果字符串的长度length本身为0返回max_length; 2.将一个字母输入到字符串temp中,如果窗口长度等于length那max_length就等于window_length; 3.判断加入下一个字符后字符串是否重复如果不重复则window_leng 阅读全文
posted @ 2023-05-04 20:28 Hbro 阅读(23) 评论(0) 推荐(0)
摘要: 1.问题描述 一个口袋中放有12个球,已知其中3个是红的,3个是白的,6个是黑的,现在从中任意取8个,问共有多少种可能的颜色搭配。 #include<iostream>using namespace std;int main(){ int m, n,ans = 0; for (m = 0; m <= 阅读全文
posted @ 2023-04-27 20:39 Hbro 阅读(26) 评论(0) 推荐(0)
摘要: #include<iostream>#include<iomanip>using namespace std;int arr[100], n, r;void dfs(int m) { if (m > r) { for (int i = 1; i <= r; i++) { cout << setw(3 阅读全文
posted @ 2023-04-26 20:55 Hbro 阅读(28) 评论(0) 推荐(0)
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) :  阅读全文
posted @ 2023-04-25 21:05 Hbro 阅读(14) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;void print(int s[]);int judgee(int c[]);int j = 0;int main(){ int sweet[10] = { 10,2,8,22,16,4,10,6,14,20 }; int 阅读全文
posted @ 2023-04-24 22:01 Hbro 阅读(21) 评论(0) 推荐(0)
摘要: #include<iostream>#include<cmath>using namespace std;int main(){ int x1, x2, x3, x5, x8, y1, y2, y3, y5, y8; double max = 0.0, result; for (x8 = 0; x8 阅读全文
posted @ 2023-04-23 20:21 Hbro 阅读(19) 评论(0) 推荐(0)
摘要: 1.问题描述: 编写一个计算个人所得税的程序,要求输入收入金额后能够输出应缴的个人所得税。个人所得税的征收办法如下 2.思路 1.建立结构体 其中包含 start(起始税费),end(阶段最大税费),taxrate(税率); 2.写出计算函数 tax += (p->end - p->start) * 阅读全文
posted @ 2023-04-22 21:08 Hbro 阅读(26) 评论(0) 推荐(0)